1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 06:25:45 +01:00

Add *very* basic (and bad) E4X highlighting for vim.

This commit is contained in:
Kris Maglione
2008-12-09 22:00:47 -05:00
parent ce8d5c369e
commit 374004e31b
7 changed files with 366 additions and 8 deletions

View File

@@ -1211,6 +1211,7 @@ function Completion() //{{{
<span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span>
{ process.call(this, item, text) }
</>];
context.completions = util.map(tabs.browsers, function ([i, browser]) {
let indicator = " ";

View File

@@ -251,7 +251,7 @@ function AutoCommands() //{{{
lastPattern = autoCmd.pattern;
liberator.echomsg("autocommand " + autoCmd.command, 9);
if (autoCmd.command instanceof Function)
if (typeof autoCmd.command == "function")
autoCmd.command.call(autoCmd, args);
else
liberator.execute(commands.replaceTokens(autoCmd.command, args));

View File

@@ -6,6 +6,7 @@
it under any or all of those licenseses.
}}} ***** END LICENSE BLOCK *****/
// <css>
Highlights.prototype.CSS = <![CDATA[
Boolean color: red;
Function color: navy;
@@ -112,6 +113,8 @@ Highlights.prototype.CSS = <![CDATA[
padding: 0;
}
]]>.toString();
// </css>
function Highlights(name, store, serial)
{
var self = this;

View File

@@ -50,6 +50,7 @@ const template = {
var desc = this.process[1].call(this, item, this.getKey(item, "description"));
}
// <e4x>
return <div highlight={class || "CompItem"} style="white-space: nowrap">
<!-- The non-breaking spaces prevent empty elements
- from pushing the baseline down and enlarging
@@ -58,6 +59,7 @@ const template = {
<li highlight="CompResult">{text}&#160;</li>
<li highlight="CompDesc">{desc}&#160;</li>
</div>;
// </e4x>
},
bookmarkDescription: function (item, text)
@@ -223,6 +225,7 @@ const template = {
jumps: function jumps(index, elems)
{
// <e4x>
return this.commandOutput(
<table>
<tr style="text-align: left;" highlight="Title">
@@ -238,10 +241,12 @@ const template = {
</tr>)
}
</table>);
// </e4x>
},
options: function options(title, opts)
{
// <e4x>
return this.commandOutput(
<table>
<tr highlight="Title" align="left">
@@ -257,11 +262,13 @@ const template = {
</tr>)
}
</table>);
// </e4x>
},
table: function table(title, data, indent)
{
let table =
// <e4x>
<table>
<tr highlight="Title" align="left">
<th colspan="2">{title}</th>
@@ -274,6 +281,7 @@ const template = {
</tr>)
}
</table>;
// </e4x>
if (table.tr.length() > 1)
return table;
},
@@ -281,6 +289,7 @@ const template = {
tabular: function tabular(headings, style, iter)
{
/* This might be mind-bogglingly slow. We'll see. */
// <e4x>
return this.commandOutput(
<table>
<tr highlight="Title" align="left">
@@ -299,10 +308,12 @@ const template = {
</tr>)
}
</table>);
// </e4x>
},
usage: function usage(iter)
{
// <e4x>
return this.commandOutput(
<table>
{
@@ -313,6 +324,7 @@ const template = {
</tr>)
}
</table>);
// </e4x>
}
};

View File

@@ -380,8 +380,7 @@ const util = { //{{{
i = parseInt(i);
else if (/^[A-Z_]+$/.test(i))
i = "";
keys.push([i, <>{key}{noVal ? "" : <>: {value}</> // Vim /
}<br/>&#xa;</>]);
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>&#xa;</>]);
}
}
catch (e) {}