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

Make JS function completion better. Fix some other completion bugs. Dont complete JS after /[\]})"/.

This commit is contained in:
Kris Maglione
2008-11-28 03:15:22 +00:00
parent ff69145da2
commit 0325ac9174
7 changed files with 78 additions and 79 deletions

View File

@@ -602,7 +602,7 @@ function Commands() //{{{
if (complete)
{
if (argCount == "0" || args.length > 0 && (argCount == "1" || argCount == "?"))
if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount)))
complete.highlight(i, sub.length, "SPELLCHECK")
}
@@ -639,9 +639,9 @@ function Commands() //{{{
if (complete)
args.completeArg = args.length - 1;
if (count <= 0)
break;
i += count;
if (count <= 0 || i == str.length)
break;
}
if (complete)
@@ -666,12 +666,14 @@ function Commands() //{{{
}
// check for correct number of arguments
if (!complete && (args.length == 0 && /^[1+]$/.test(argCount) ||
// TODO: what is this for? -- djk
literal && argCount == "+" && /^\s*$/.test(args.literalArg)))
if (args.length == 0 && /^[1+]$/.test(argCount) ||
literal && argCount == "+" && /^\s*$/.test(args.literalArg))
{
liberator.echoerr("E471: Argument required");
return null;
if (!complete)
{
liberator.echoerr("E471: Argument required");
return null;
}
}
else if (args.length == 1 && (argCount == "0") ||
args.length > 1 && /^[01?]$/.test(argCount))