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:
@@ -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 = " ";
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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} </li>
|
||||
<li highlight="CompDesc">{desc} </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>
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -380,8 +380,7 @@ const util = { //{{{
|
||||
i = parseInt(i);
|
||||
else if (/^[A-Z_]+$/.test(i))
|
||||
i = "";
|
||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</> // Vim /
|
||||
}<br/>
</>]);
|
||||
keys.push([i, <>{key}{noVal ? "" : <>: {value}</>}<br/>
</>]);
|
||||
}
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
Reference in New Issue
Block a user