1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:08:00 +01:00

Partially fix completions with mismatched start offsets

This commit is contained in:
Kris Maglione
2008-11-24 11:12:06 +00:00
parent 862a6cae7c
commit ced94146f8
3 changed files with 12 additions and 9 deletions

View File

@@ -618,17 +618,20 @@ function Commands() //{{{
{
let opt = args.completeOpt;
let context = complete.fork(opt[0][0], args.completeStart);
context.filter = args.completeFilter;
if (typeof opt[3] == "function")
var compl = opt[3](context, args);
else
compl = opt[3] || [];
context.title = [opt[0][0]];
context.completions = completion.filter(compl.map(function ([k, v]) [args.quote(k), v]), args.completeFilter);;
context.quote = args.quote;
context.completions = compl;
}
complete.advance(args.completeStart);
complete.title = ["Options"];
if (completeOpts)
complete.completions = completeOpts;
}
// check for correct number of arguments