Fix: use Math.max
This commit is contained in:
parent
a7b73e859f
commit
caaeec08e4
|
@ -107,10 +107,7 @@ function createAppliesToLineWidget(cm) {
|
|||
const toIndex = widgets[j] ? cm.indexFromPos({line: widgets[j].line.lineNo(), ch: 0}) : cm.getValue().length;
|
||||
|
||||
// splice
|
||||
if (i < 0) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
i = Math.max(0, i);
|
||||
widgets.splice(i, 0, ...createWidgets(fromIndex, toIndex, widgets.splice(i, j - i)));
|
||||
|
||||
fromLine = null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user