mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-16 20:53:33 +02:00
Anchor option completion matches
This commit is contained in:
@@ -309,7 +309,7 @@ CompletionContext.prototype = {
|
|||||||
get substrings()
|
get substrings()
|
||||||
{
|
{
|
||||||
let items = this.items;
|
let items = this.items;
|
||||||
if (items.length == 0)
|
if (items.length == 0 || !this.hasItems)
|
||||||
return [];
|
return [];
|
||||||
if (this._substrings)
|
if (this._substrings)
|
||||||
return this._substrings;
|
return this._substrings;
|
||||||
@@ -1395,6 +1395,7 @@ function Completion() //{{{
|
|||||||
option: function option(context, scope)
|
option: function option(context, scope)
|
||||||
{
|
{
|
||||||
context.title = ["Option"];
|
context.title = ["Option"];
|
||||||
|
context.anchored = true;
|
||||||
context.keys = { text: "names", description: "description" };
|
context.keys = { text: "names", description: "description" };
|
||||||
context.completions = options;
|
context.completions = options;
|
||||||
if (scope)
|
if (scope)
|
||||||
|
|||||||
@@ -683,8 +683,6 @@ function Options() //{{{
|
|||||||
|
|
||||||
let opt = options.parseOpt(filter, modifiers);
|
let opt = options.parseOpt(filter, modifiers);
|
||||||
let prefix = opt.prefix;
|
let prefix = opt.prefix;
|
||||||
if (prefix)
|
|
||||||
context.advance(prefix.length);
|
|
||||||
|
|
||||||
if (context.filter.indexOf("=") == -1)
|
if (context.filter.indexOf("=") == -1)
|
||||||
{
|
{
|
||||||
@@ -695,6 +693,9 @@ function Options() //{{{
|
|||||||
else if (prefix == "no")
|
else if (prefix == "no")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (prefix)
|
||||||
|
context.advance(prefix.length);
|
||||||
|
|
||||||
let option = opt.option;
|
let option = opt.option;
|
||||||
context.advance(context.filter.indexOf("=") + 1);
|
context.advance(context.filter.indexOf("=") + 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user