mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 17:57:59 +01:00
change {count} to [count] in the usage strings since specifying a count is
always optional
This commit is contained in:
@@ -243,7 +243,7 @@ function Commands() //{{{
|
|||||||
vimperator.history.stepTo(count > 0 ? -1 * count : -1);
|
vimperator.history.stepTo(count > 0 ? -1 * count : -1);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["{count}ba[ck][!]"],
|
usage: ["[count]ba[ck][!]"],
|
||||||
short_help: "Go back in the browser history",
|
short_help: "Go back in the browser history",
|
||||||
help: "Count is supported, <code class=\"command\">:3back</code> goes back 3 pages in the browser history.<br/>" +
|
help: "Count is supported, <code class=\"command\">:3back</code> goes back 3 pages in the browser history.<br/>" +
|
||||||
"The special version <code class=\"command\">:back!</code> goes to the beginning of the browser history."
|
"The special version <code class=\"command\">:back!</code> goes to the beginning of the browser history."
|
||||||
@@ -252,7 +252,7 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
|
addDefaultCommand(new Command(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
|
||||||
function(args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, special, 0); },
|
function(args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, special, 0); },
|
||||||
{
|
{
|
||||||
usage: ["{count}bd[elete][!]"],
|
usage: ["[count]bd[elete][!]"],
|
||||||
short_help: "Delete current buffer (=tab)",
|
short_help: "Delete current buffer (=tab)",
|
||||||
help: "Count WILL be supported in future releases, then <code class=\"command\">:2bd</code> removes two tabs and the one to the right is selected.<br/>Do <code class=\"command\">:bdelete!</code> to select the tab to the left after removing the current tab."
|
help: "Count WILL be supported in future releases, then <code class=\"command\">:2bd</code> removes two tabs and the one to the right is selected.<br/>Do <code class=\"command\">:bdelete!</code> to select the tab to the left after removing the current tab."
|
||||||
}
|
}
|
||||||
@@ -475,7 +475,7 @@ function Commands() //{{{
|
|||||||
vimperator.history.stepTo(count > 0 ? count : 1);
|
vimperator.history.stepTo(count > 0 ? count : 1);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["{count}fo[rward][!]"],
|
usage: ["[count]fo[rward][!]"],
|
||||||
short_help: "Go forward in the browser history",
|
short_help: "Go forward in the browser history",
|
||||||
help: "Count is supported, <code class=\"command\">:3forward</code> goes forward 3 pages in the browser history.<br/>" +
|
help: "Count is supported, <code class=\"command\">:3forward</code> goes forward 3 pages in the browser history.<br/>" +
|
||||||
"The special version <code class=\"command\">:forward!</code> goes to the end of the browser history."
|
"The special version <code class=\"command\">:forward!</code> goes to the end of the browser history."
|
||||||
@@ -1040,7 +1040,7 @@ function Commands() //{{{
|
|||||||
addDefaultCommand(new Command(["u[ndo]"],
|
addDefaultCommand(new Command(["u[ndo]"],
|
||||||
function(args, special, count) { if (count < 1) count = 1; undoCloseTab(count-1); },
|
function(args, special, count) { if (count < 1) count = 1; undoCloseTab(count-1); },
|
||||||
{
|
{
|
||||||
usage: ["{count}u[ndo]"],
|
usage: ["[count]u[ndo]"],
|
||||||
short_help: "Undo closing of a tab",
|
short_help: "Undo closing of a tab",
|
||||||
help: "If a count is given, don't close the last but the n'th last tab."
|
help: "If a count is given, don't close the last but the n'th last tab."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ vimperator.help = function(section, easter) //{{{
|
|||||||
usage = usage.replace(/</g, "<");
|
usage = usage.replace(/</g, "<");
|
||||||
usage = usage.replace(/>/g, ">");
|
usage = usage.replace(/>/g, ">");
|
||||||
usage = usage.replace(/\\n/g, "<br/>");
|
usage = usage.replace(/\\n/g, "<br/>");
|
||||||
// color {count}, [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now)
|
// color [count], [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now)
|
||||||
usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args
|
usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args
|
||||||
usage = usage.replace(/([^A-Za-z])(\[[^!\]]+\])/g, "$1<span class=\"argument\">$2</span>"); // optional args
|
usage = usage.replace(/(^|[^A-Za-z])(\[[^!\]]+\])/g, "$1<span class=\"argument\">$2</span>"); // optional args
|
||||||
usage = usage.replace(/\[!\]/, "<span class=\"argument\">[!]</span>"); // special
|
usage = usage.replace(/\[!\]/, "<span class=\"argument\">[!]</span>"); // special
|
||||||
// and the 'option' in a different color
|
// and the 'option' in a different color
|
||||||
usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"option\">$1</span>'");
|
usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"option\">$1</span>'");
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function Map(mode, cmds, action, extra_info) //{{{
|
|||||||
{
|
{
|
||||||
this.usage = this.names[0]; // only the first command name
|
this.usage = this.names[0]; // only the first command name
|
||||||
if (this.flags & Mappings.flags.COUNT)
|
if (this.flags & Mappings.flags.COUNT)
|
||||||
this.usage = "{count}" + this.usage;
|
this.usage = "[count]" + this.usage;
|
||||||
if (this.flags & Mappings.flags.ARGUMENT)
|
if (this.flags & Mappings.flags.ARGUMENT)
|
||||||
this.usage += " {arg}";
|
this.usage += " {arg}";
|
||||||
this.usage = [this.usage]; // FIXME: usage an array - needed for the help
|
this.usage = [this.usage]; // FIXME: usage an array - needed for the help
|
||||||
@@ -406,7 +406,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.tabs.select(count > 0 ? count -1: "+1", count > 0 ? false : true); },
|
function(count) { vimperator.tabs.select(count > 0 ? count -1: "+1", count > 0 ? false : true); },
|
||||||
{
|
{
|
||||||
short_help: "Go to the next tab",
|
short_help: "Go to the next tab",
|
||||||
help: "Cycles to the first tab, when the last is selected.<br/>Count is supported, <code class=\"mapping\">3gt</code> goes to the third tab.",
|
help: "Cycles to the first tab, when the last is selected.<br/>Count is supported: <code class=\"mapping\">3gt</code> goes to the third tab.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -414,7 +414,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.tabs.select(count > 0 ? count -1: "-1", count > 0 ? false : true); },
|
function(count) { vimperator.tabs.select(count > 0 ? count -1: "-1", count > 0 ? false : true); },
|
||||||
{
|
{
|
||||||
short_help: "Go to the previous tab",
|
short_help: "Go to the previous tab",
|
||||||
help: "Cycles to the last tab, when the first is selected.<br/>Count is supported, <code class=\"mapping\">3gT</code> goes to the third tab.",
|
help: "Cycles to the last tab, when the first is selected.<br/>Count is supported: <code class=\"mapping\">3gT</code> goes to the third tab.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -531,7 +531,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.commands.undo("", false, count); },
|
function(count) { vimperator.commands.undo("", false, count); },
|
||||||
{
|
{
|
||||||
short_help: "Undo closing of a tab",
|
short_help: "Undo closing of a tab",
|
||||||
help: "If a count is given, don't close the last but the n'th last tab.",
|
help: "If a count is given, don't close the last but the <code class=\"argument\">count</code>th last tab.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -563,7 +563,6 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.zoomIn(count > 0 ? count : 1); },
|
function(count) { vimperator.buffer.zoomIn(count > 0 ? count : 1); },
|
||||||
{
|
{
|
||||||
short_help: "Zoom in current web page by 25%",
|
short_help: "Zoom in current web page by 25%",
|
||||||
help: "Currently no count supported.",
|
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -571,7 +570,6 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.zoomIn((count > 0 ? count : 1) * 4); },
|
function(count) { vimperator.buffer.zoomIn((count > 0 ? count : 1) * 4); },
|
||||||
{
|
{
|
||||||
short_help: "Zoom in current web page by 100%",
|
short_help: "Zoom in current web page by 100%",
|
||||||
help: "Currently no count supported.",
|
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -579,7 +577,6 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.zoomOut(count > 0 ? count : 1); },
|
function(count) { vimperator.buffer.zoomOut(count > 0 ? count : 1); },
|
||||||
{
|
{
|
||||||
short_help: "Zoom out current web page by 25%",
|
short_help: "Zoom out current web page by 25%",
|
||||||
help: "Currently no count supported.",
|
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -587,7 +584,6 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.zoomOut((count > 0 ? count : 1) * 4); },
|
function(count) { vimperator.buffer.zoomOut((count > 0 ? count : 1) * 4); },
|
||||||
{
|
{
|
||||||
short_help: "Zoom out current web page by 100%",
|
short_help: "Zoom out current web page by 100%",
|
||||||
help: "Currently no count supported.",
|
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -596,7 +592,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.textZoom = count > 0 ? count : 100; },
|
function(count) { vimperator.buffer.textZoom = count > 0 ? count : 100; },
|
||||||
{
|
{
|
||||||
short_help: "Set zoom value of the web page",
|
short_help: "Set zoom value of the web page",
|
||||||
help: "Zoom value can be between 25 and 500%. If it is omitted, zoom is reset to 100%.",
|
help: "Zoom value can be between 1 and 2000%. If it is omitted, zoom is reset to 100%.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -634,7 +630,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.scrollAbsolute(-1, count > 0 ? count : 0); },
|
function(count) { vimperator.buffer.scrollAbsolute(-1, count > 0 ? count : 0); },
|
||||||
{
|
{
|
||||||
short_help: "Goto the top of the document",
|
short_help: "Goto the top of the document",
|
||||||
help: "Count is supported, <code class=\"mapping\">35gg</code> vertically goes to 35% of the document.",
|
help: "Count is supported: <code class=\"mapping\">35gg</code> vertically goes to 35% of the document.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -642,7 +638,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.buffer.scrollAbsolute(-1, count >= 0 ? count : 100); },
|
function(count) { vimperator.buffer.scrollAbsolute(-1, count >= 0 ? count : 100); },
|
||||||
{
|
{
|
||||||
short_help: "Goto the end of the document",
|
short_help: "Goto the end of the document",
|
||||||
help: "Count is supported, <code class=\"mapping\">35G</code> vertically goes to 35% of the document.",
|
help: "Count is supported: <code class=\"mapping\">35G</code> vertically goes to 35% of the document.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -751,7 +747,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.history.stepTo(count > 0 ? -1 * count : -1); },
|
function(count) { vimperator.history.stepTo(count > 0 ? -1 * count : -1); },
|
||||||
{
|
{
|
||||||
short_help: "Go back in the browser history",
|
short_help: "Go back in the browser history",
|
||||||
help: "Count is supported, <code class=\"mapping\">3H</code> goes back 3 steps.",
|
help: "Count is supported: <code class=\"mapping\">3H</code> goes back 3 steps.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -759,7 +755,7 @@ function Mappings() //{{{
|
|||||||
function(count) { vimperator.history.stepTo(count > 0 ? count : 1); },
|
function(count) { vimperator.history.stepTo(count > 0 ? count : 1); },
|
||||||
{
|
{
|
||||||
short_help: "Go forward in the browser history",
|
short_help: "Go forward in the browser history",
|
||||||
help: "Count is supported, <code class=\"mapping\">3L</code> goes forward 3 steps.",
|
help: "Count is supported: <code class=\"mapping\">3L</code> goes forward 3 steps.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -782,7 +778,7 @@ function Mappings() //{{{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
short_help: "Go to parent directory",
|
short_help: "Go to parent directory",
|
||||||
help: "Count is supported, <code class=\"mapping\">2gu</code> on <code>http://www.example.com/dir1/dir2/file.htm</code> would open <code>http://www.example.com/dir1/</code>.",
|
help: "Count is supported: <code class=\"mapping\">2gu</code> on <code>http://www.example.com/dir1/dir2/file.htm</code> would open <code>http://www.example.com/dir1/</code>.",
|
||||||
flags: Mappings.flags.COUNT
|
flags: Mappings.flags.COUNT
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user