1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:57:58 +01:00

added framework for :foo! <tab> special completion

This commit is contained in:
Martin Stubenschrott
2008-01-07 16:23:26 +00:00
parent a43249672f
commit 52df3a24dc
3 changed files with 8 additions and 5 deletions

View File

@@ -279,7 +279,7 @@ vimperator.Completion = function () //{{{
substrings = [];
for (var command in vimperator.commands)
helpArray.push([command.longNames.map(function ($_) { return ":" + $_; }), command.shortHelp]);
options = this.option(filter, true);
options = this.option(filter, false, true);
helpArray = helpArray.concat(options.map(function ($_) {
return [
$_[0].map(function ($_) { return "'" + $_ + "'"; }),
@@ -346,7 +346,7 @@ vimperator.Completion = function () //{{{
return [0, buildLongestStartingSubstring(completions, filter)];
},
option: function (filter, unfiltered)
option: function (filter, special, unfiltered)
{
substrings = [];
var optionCompletions = [];
@@ -369,6 +369,9 @@ vimperator.Completion = function () //{{{
return options;
}
if (special)
alert(":set! completion will complete about:config options");
if (!filter)
{
var options = [];
@@ -698,7 +701,7 @@ vimperator.Completion = function () //{{{
{
matches = str.match(/^:*\d*\w+!?\s+/);
exLength = matches ? matches[0].length : 0;
[start, completions] = command.completer.call(this, args);
[start, completions] = command.completer.call(this, args, special);
}
return [exLength + start, completions];
}