1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-10 21:55:48 +01:00

Anchor option completion matches

This commit is contained in:
Kris Maglione
2008-11-30 12:35:37 +00:00
parent a2d269d5d7
commit 20c6aca867
2 changed files with 5 additions and 3 deletions

View File

@@ -309,7 +309,7 @@ CompletionContext.prototype = {
get substrings()
{
let items = this.items;
if (items.length == 0)
if (items.length == 0 || !this.hasItems)
return [];
if (this._substrings)
return this._substrings;
@@ -1395,6 +1395,7 @@ function Completion() //{{{
option: function option(context, scope)
{
context.title = ["Option"];
context.anchored = true;
context.keys = { text: "names", description: "description" };
context.completions = options;
if (scope)

View File

@@ -683,8 +683,6 @@ function Options() //{{{
let opt = options.parseOpt(filter, modifiers);
let prefix = opt.prefix;
if (prefix)
context.advance(prefix.length);
if (context.filter.indexOf("=") == -1)
{
@@ -695,6 +693,9 @@ function Options() //{{{
else if (prefix == "no")
return;
if (prefix)
context.advance(prefix.length);
let option = opt.option;
context.advance(context.filter.indexOf("=") + 1);