mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 22:37:58 +01:00
use the singular form for completion methods
This commit is contained in:
@@ -260,7 +260,7 @@ vimperator.Buffer = function () //{{{
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var items = vimperator.completion.buffers("")[1];
|
var items = vimperator.completion.buffer("")[1];
|
||||||
vimperator.bufferwindow.show(items);
|
vimperator.bufferwindow.show(items);
|
||||||
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
||||||
}
|
}
|
||||||
@@ -268,7 +268,7 @@ vimperator.Buffer = function () //{{{
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: move this to vimperator.buffers.get()
|
// TODO: move this to vimperator.buffers.get()
|
||||||
var items = vimperator.completion.buffers("")[1];
|
var items = vimperator.completion.buffer("")[1];
|
||||||
var number, indicator, title, url;
|
var number, indicator, title, url;
|
||||||
|
|
||||||
var list = ":" + vimperator.util.escapeHTML(vimperator.commandline.getCommand()) + "<br/>" + "<table>";
|
var list = ":" + vimperator.util.escapeHTML(vimperator.commandline.getCommand()) + "<br/>" + "<table>";
|
||||||
@@ -451,7 +451,7 @@ vimperator.Buffer = function () //{{{
|
|||||||
if (!vimperator.bufferwindow.visible())
|
if (!vimperator.bufferwindow.visible())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var items = vimperator.completion.buffers("")[1];
|
var items = vimperator.completion.buffer("")[1];
|
||||||
vimperator.bufferwindow.show(items);
|
vimperator.bufferwindow.show(items);
|
||||||
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ vimperator.Commands = function () //{{{
|
|||||||
"it is selected. With <code class=\"argument\">[!]</code> the next buffer matching the argument " +
|
"it is selected. With <code class=\"argument\">[!]</code> the next buffer matching the argument " +
|
||||||
"is selected, even if it cannot be identified uniquely.<br/>" +
|
"is selected, even if it cannot be identified uniquely.<br/>" +
|
||||||
"Use <code class=\"mapping\">b</code> as a shortcut to open this prompt.",
|
"Use <code class=\"mapping\">b</code> as a shortcut to open this prompt.",
|
||||||
completer: function (filter) { return vimperator.completion.buffers(filter); }
|
completer: function (filter) { return vimperator.completion.buffer(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
commandManager.add(new vimperator.Command(["dia[log]"],
|
commandManager.add(new vimperator.Command(["dia[log]"],
|
||||||
@@ -1937,7 +1937,7 @@ vimperator.Commands = function () //{{{
|
|||||||
"<code class=\"command\">:set option+={value}</code>, <code class=\"command\">:set option^={value}</code> and <code class=\"command\">:set option-={value}</code> " +
|
"<code class=\"command\">:set option+={value}</code>, <code class=\"command\">:set option^={value}</code> and <code class=\"command\">:set option-={value}</code> " +
|
||||||
"adds/multiplies/subtracts <code class=\"argument\">{value}</code> from a number option and appends/prepends/removes <code class=\"argument\">{value}</code> from a string option.<br/>" +
|
"adds/multiplies/subtracts <code class=\"argument\">{value}</code> from a number option and appends/prepends/removes <code class=\"argument\">{value}</code> from a string option.<br/>" +
|
||||||
"<code class=\"command\">:set all</code> shows the current value of all options and <code class=\"command\">:set all&</code> resets all options to their default values.<br/>",
|
"<code class=\"command\">:set all</code> shows the current value of all options and <code class=\"command\">:set all&</code> resets all options to their default values.<br/>",
|
||||||
completer: function (filter) { return vimperator.completion.options(filter); }
|
completer: function (filter) { return vimperator.completion.option(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
// TODO: sclose instead?
|
// TODO: sclose instead?
|
||||||
@@ -2036,7 +2036,7 @@ vimperator.Commands = function () //{{{
|
|||||||
help: "Works only for commands that support it, currently:" +
|
help: "Works only for commands that support it, currently:" +
|
||||||
"<ul><li>:tab help</li>" +
|
"<ul><li>:tab help</li>" +
|
||||||
"<li>:tab prefs[!]</li></ul>",
|
"<li>:tab prefs[!]</li></ul>",
|
||||||
completer: function (filter) { return vimperator.completion.commands(filter); }
|
completer: function (filter) { return vimperator.completion.command(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
commandManager.add(new vimperator.Command(["tabl[ast]"],
|
commandManager.add(new vimperator.Command(["tabl[ast]"],
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ vimperator.Completion = function () //{{{
|
|||||||
substrings = [];
|
substrings = [];
|
||||||
for (var command in vimperator.commands)
|
for (var command in vimperator.commands)
|
||||||
helpArray.push([command.longNames.map(function ($_) { return ":" + $_; }), command.shortHelp]);
|
helpArray.push([command.longNames.map(function ($_) { return ":" + $_; }), command.shortHelp]);
|
||||||
options = this.options(filter, true);
|
options = this.option(filter, true);
|
||||||
helpArray = helpArray.concat(options.map(function ($_) {
|
helpArray = helpArray.concat(options.map(function ($_) {
|
||||||
return [
|
return [
|
||||||
$_[0].map(function ($_) { return "'" + $_ + "'"; }),
|
$_[0].map(function ($_) { return "'" + $_ + "'"; }),
|
||||||
@@ -281,7 +281,7 @@ vimperator.Completion = function () //{{{
|
|||||||
return [0, buildLongestCommonSubstring(helpArray, filter)];
|
return [0, buildLongestCommonSubstring(helpArray, filter)];
|
||||||
},
|
},
|
||||||
|
|
||||||
commands: function (filter)
|
command: function (filter)
|
||||||
{
|
{
|
||||||
substrings = [];
|
substrings = [];
|
||||||
var completions = [];
|
var completions = [];
|
||||||
@@ -298,7 +298,7 @@ vimperator.Completion = function () //{{{
|
|||||||
return [0, buildLongestStartingSubstring(completions, filter)];
|
return [0, buildLongestStartingSubstring(completions, filter)];
|
||||||
},
|
},
|
||||||
|
|
||||||
options: function (filter, unfiltered)
|
option: function (filter, unfiltered)
|
||||||
{
|
{
|
||||||
substrings = [];
|
substrings = [];
|
||||||
var optionCompletions = [];
|
var optionCompletions = [];
|
||||||
@@ -377,7 +377,7 @@ vimperator.Completion = function () //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: items shouldn't be [[[a], b]], but [[a, b]] and only mapped if at all for bLCS --mst
|
// FIXME: items shouldn't be [[[a], b]], but [[a, b]] and only mapped if at all for bLCS --mst
|
||||||
buffers: function (filter)
|
buffer: function (filter)
|
||||||
{
|
{
|
||||||
substrings = [];
|
substrings = [];
|
||||||
var items = [];
|
var items = [];
|
||||||
@@ -642,7 +642,7 @@ vimperator.Completion = function () //{{{
|
|||||||
// then get completions of the command name
|
// then get completions of the command name
|
||||||
var matches = str.match(/^(:*\d*)\w*$/);
|
var matches = str.match(/^(:*\d*)\w*$/);
|
||||||
if (matches)
|
if (matches)
|
||||||
return [matches[1].length, this.commands(cmd)[1]];
|
return [matches[1].length, this.command(cmd)[1]];
|
||||||
|
|
||||||
// dynamically get completions as specified with the command's completer function
|
// dynamically get completions as specified with the command's completer function
|
||||||
var command = vimperator.commands.get(cmd);
|
var command = vimperator.commands.get(cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user