mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:32:27 +01:00
add 'wildoptions' completion
This commit is contained in:
@@ -715,6 +715,10 @@ liberator.Options = function () //{{{
|
|||||||
continue;
|
continue;
|
||||||
if (option.hasName(filter))
|
if (option.hasName(filter))
|
||||||
{
|
{
|
||||||
|
// TODO: the starting value should be the current
|
||||||
|
// value, for compatibility with Vim (also the most
|
||||||
|
// useful approach in this case) while still
|
||||||
|
// offering much better completion
|
||||||
if (option.completer)
|
if (option.completer)
|
||||||
return [filter.length + 1, option.completer(filter)]; // FIXME: filter should be component after "option="
|
return [filter.length + 1, option.completer(filter)]; // FIXME: filter should be component after "option="
|
||||||
return [filter.length + 1, [[option.value + "", ""]]];
|
return [filter.length + 1, [[option.value + "", ""]]];
|
||||||
|
|||||||
@@ -367,6 +367,13 @@ liberator.CommandLine = function () //{{{
|
|||||||
"Change how command line completion is done",
|
"Change how command line completion is done",
|
||||||
"stringlist", "",
|
"stringlist", "",
|
||||||
{
|
{
|
||||||
|
completer: function (value)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
["auto", "Automatically show completions while you are typing"],
|
||||||
|
["sort", "Always sort the completion list"]
|
||||||
|
];
|
||||||
|
},
|
||||||
validator: function (value)
|
validator: function (value)
|
||||||
{
|
{
|
||||||
return value.split(",").every(function (item) { return /^(sort|auto|)$/.test(item); });
|
return value.split(",").every(function (item) { return /^(sort|auto|)$/.test(item); });
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ the second part for the second use, etc.
|
|||||||
|
|
||||||
These are the possible values for each part:
|
These are the possible values for each part:
|
||||||
`---------------`------------------------
|
`---------------`------------------------
|
||||||
"" Complete only the first match
|
"" Complete only the first match.
|
||||||
"full" Complete the next full match. After the last, the original string is used.
|
"full" Complete the next full match. After the last, the original string is used.
|
||||||
"longest" Complete till the longest common string.
|
"longest" Complete till the longest common string.
|
||||||
"list" When more than one match, list all matches.
|
"list" When more than one match, list all matches.
|
||||||
@@ -753,8 +753,8 @@ A list of words that change how command line completion is done.
|
|||||||
|
|
||||||
Possible words:
|
Possible words:
|
||||||
`--------`-------------------------------
|
`--------`-------------------------------
|
||||||
*auto* Automatically show completions while you are typing
|
*auto* Automatically show completions while you are typing.
|
||||||
*sort* Always sorts completion list, overriding the 'complete' option.
|
*sort* Always sort the completion list, overriding the 'complete' option.
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
____
|
____
|
||||||
|
|||||||
Reference in New Issue
Block a user