parent
15dd2082f6
commit
c01725184e
1 changed files with 13 additions and 14 deletions
|
|
@ -110,15 +110,13 @@ function DefaultHandlers(mouseHandler) {
|
||||||
var editor = this.editor;
|
var editor = this.editor;
|
||||||
// allow double/triple click handlers to change selection
|
// allow double/triple click handlers to change selection
|
||||||
var shiftPressed = this.mousedownEvent.getShiftKey();
|
var shiftPressed = this.mousedownEvent.getShiftKey();
|
||||||
setTimeout(function(){
|
if (shiftPressed) {
|
||||||
if (shiftPressed) {
|
editor.selection.selectToPosition(pos);
|
||||||
editor.selection.selectToPosition(pos);
|
}
|
||||||
}
|
else if (!this.$clickSelection) {
|
||||||
else if (!this.$clickSelection) {
|
editor.moveCursorToPosition(pos);
|
||||||
editor.moveCursorToPosition(pos);
|
editor.selection.clearSelection();
|
||||||
editor.selection.clearSelection();
|
}
|
||||||
}
|
|
||||||
}.bind(this), 0);
|
|
||||||
if (editor.renderer.scroller.setCapture) {
|
if (editor.renderer.scroller.setCapture) {
|
||||||
editor.renderer.scroller.setCapture();
|
editor.renderer.scroller.setCapture();
|
||||||
}
|
}
|
||||||
|
|
@ -210,13 +208,13 @@ function DefaultHandlers(mouseHandler) {
|
||||||
range.start.column--;
|
range.start.column--;
|
||||||
range.end.column++;
|
range.end.column++;
|
||||||
}
|
}
|
||||||
this.$clickSelection = range;
|
|
||||||
this.setState("select");
|
this.setState("select");
|
||||||
return;
|
} else {
|
||||||
|
range = editor.selection.getWordRange(pos.row, pos.column);
|
||||||
|
this.setState("selectByWords");
|
||||||
}
|
}
|
||||||
|
this.$clickSelection = range;
|
||||||
this.$clickSelection = editor.selection.getWordRange(pos.row, pos.column);
|
this[this.state] && this[this.state](ev);
|
||||||
this.setState("selectByWords");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onTripleClick = function(ev) {
|
this.onTripleClick = function(ev) {
|
||||||
|
|
@ -225,6 +223,7 @@ function DefaultHandlers(mouseHandler) {
|
||||||
|
|
||||||
this.setState("selectByLines");
|
this.setState("selectByLines");
|
||||||
this.$clickSelection = editor.selection.getLineRange(pos.row);
|
this.$clickSelection = editor.selection.getLineRange(pos.row);
|
||||||
|
this[this.state] && this[this.state](ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onQuadClick = function(ev) {
|
this.onQuadClick = function(ev) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue