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

Dont show substring preview when caret isnt at end of line. Fix unanchored substring generation.

This commit is contained in:
Kris Maglione
2008-11-28 09:02:03 +00:00
parent 25d983ec01
commit 082d9d12fa
4 changed files with 8 additions and 9 deletions

View File

@@ -314,7 +314,7 @@ CompletionContext.prototype = {
let start = 0;
let idx;
let length = filter.length;
while ((idx = text.indexOf(filter, start)) > -1 && idx < length)
while ((idx = text.indexOf(filter, start)) > -1 && idx < text.length)
{
for (let end in util.range(idx + length, text.length + 1))
substrings.push(text.substring(idx, end));
@@ -1372,12 +1372,13 @@ function Completion() //{{{
// TODO: Highlight when invalid
context.advance(context.filter.length - len);
/* Not vim compatible, but is a significant enough improvement
* that it's worth breaking compatibility.
*/
context.title = ["Option Value"];
let completions = completer(context);
if (!completions)
return;
/* Not vim compatible, but is a significant enough improvement
* that it's worth breaking compatibility.
*/
if (newValues instanceof Array)
{
completions = completions.filter(function (val) newValues.indexOf(val[0]) == -1);