fixup c8c02805: +1 only when no previous widget found

This commit is contained in:
tophf 2017-11-26 05:09:16 +03:00
parent 95ebe96bc2
commit 74e6ea5a56

View File

@ -151,7 +151,7 @@ function createAppliesToLineWidget(cm) {
// decide search range // decide search range
const fromIndex = widgets[i] ? cm.indexFromPos({line: widgets[i].line.lineNo(), ch: 0}) : 0; const fromIndex = widgets[i] ? cm.indexFromPos({line: widgets[i].line.lineNo(), ch: 0}) : 0;
const toIndex = cm.indexFromPos({line: (widgets[j] ? widgets[j].line.lineNo() : toLine) + 1, ch: 0}); const toIndex = cm.indexFromPos({line: widgets[j] ? widgets[j].line.lineNo() : toLine + 1, ch: 0});
// splice // splice
i = Math.max(0, i); i = Math.max(0, i);