Workaround CodeMirror won't draw selections outside of the viewport which will cause cursor related element blinking on scrolling

This commit is contained in:
Cheng-Han, Wu 2016-06-17 15:55:51 +08:00
parent 30c8420e30
commit 3498b9fae9
2 changed files with 11 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -2318,7 +2318,7 @@
for (var i = 0; i < doc.sel.ranges.length; i++) { for (var i = 0; i < doc.sel.ranges.length; i++) {
if (primary === false && i == doc.sel.primIndex) continue; if (primary === false && i == doc.sel.primIndex) continue;
var range = doc.sel.ranges[i]; var range = doc.sel.ranges[i];
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue; //if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue;
var collapsed = range.empty(); var collapsed = range.empty();
if (collapsed || cm.options.showCursorWhenSelecting) if (collapsed || cm.options.showCursorWhenSelecting)
drawSelectionCursor(cm, range.head, curFragment); drawSelectionCursor(cm, range.head, curFragment);