mirror of
https://github.com/slap-editor/slap.git
synced 2024-09-19 16:57:26 +03:00
Fixes selection flicker on click
This commit is contained in:
parent
90a2469857
commit
4dc4cca34e
@ -677,7 +677,11 @@ Editor.prototype._initHandlers = function () {
|
||||
}
|
||||
self.select({x: startX, y: mouse.y}, {x: endX, y: mouse.y});
|
||||
} else {
|
||||
if (!self.data.mouseDown) self.startSelection(mouse);
|
||||
if (!self.data.mouseDown) {
|
||||
self.data.hideSelection = true;
|
||||
self.startSelection(mouse);
|
||||
self.data.hideSelection = false;
|
||||
}
|
||||
self.data.mouseDown = true;
|
||||
}
|
||||
}
|
||||
@ -802,7 +806,7 @@ Editor.prototype.render = function () {
|
||||
line.slice(markupScrollX, markup.index(line, x + size.x)) +
|
||||
_.repeat(' ', size.x).join('');
|
||||
|
||||
if (selectionStyle && visibleSelection.start.y <= y && y <= visibleSelection.end.y) {
|
||||
if (!self.data.hideSelection && selectionStyle && visibleSelection.start.y <= y && y <= visibleSelection.end.y) {
|
||||
line = markup(line, selectionStyle,
|
||||
y === visibleSelection.start.y ? visibleSelection.start.x - x : 0,
|
||||
y === visibleSelection.end.y ? visibleSelection.end.x - x : Infinity);
|
||||
|
Loading…
Reference in New Issue
Block a user