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