mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:08:00 +01:00
Dont show substring preview when caret isnt at end of line. Fix unanchored substring generation.
This commit is contained in:
@@ -495,8 +495,8 @@ function Buffer() //{{{
|
||||
argCount: "?",
|
||||
completer: function (context)
|
||||
{
|
||||
context.title = ["Page Info"];
|
||||
completion.optionValue(context, "pageinfo", "+", "");
|
||||
context.title = ["Page Info"];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -695,9 +695,8 @@ function Options() //{{{
|
||||
else if (prefix == "no")
|
||||
return;
|
||||
|
||||
let [name, value] = context.filter.split("=", 2);
|
||||
let option = opt.option;
|
||||
context.advance(name.length + 1);
|
||||
context.advance(context.filter.indexOf("=") + 1);
|
||||
|
||||
if (!option)
|
||||
context.highlight(0, name.length, "SPELLCHECK");
|
||||
@@ -713,7 +712,6 @@ function Options() //{{{
|
||||
});
|
||||
}
|
||||
|
||||
context.title = ["Option Value"];
|
||||
completion.optionValue(context, opt.name, opt.operator);
|
||||
},
|
||||
literal: true,
|
||||
|
||||
@@ -319,7 +319,7 @@ function CommandLine() //{{{
|
||||
catch (e) {}
|
||||
let wildmode = options.get("wildmode");
|
||||
let wildType = wildmode.values[Math.min(wildIndex, wildmode.values.length - 1)];
|
||||
if (wildmode.checkHas(wildType, "longest"))
|
||||
if (wildmode.checkHas(wildType, "longest") && commandWidget.selectionStart == commandWidget.value.length)
|
||||
{
|
||||
// highlight= won't work here.
|
||||
let start = commandWidget.selectionStart;
|
||||
|
||||
Reference in New Issue
Block a user