remove setTimeout from startSelect

fixes #956: double tap regression
This commit is contained in:
nightwing 2013-12-20 17:17:00 +04:00
commit c01725184e

View file

@ -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) {