fix regression

This commit is contained in:
Fabian Jakobs 2010-10-08 12:02:46 +02:00
commit 52c6d89b5d

View file

@ -275,9 +275,13 @@ var Editor = function(renderer, doc) {
var pos = this.renderer.screenToTextCoordinates(pageX, pageY); var pos = this.renderer.screenToTextCoordinates(pageX, pageY);
pos.row = Math.max(0, Math.min(pos.row, this.doc.getLength()-1)); pos.row = Math.max(0, Math.min(pos.row, this.doc.getLength()-1));
this.moveCursorToPosition(pos); if (e.shiftKey)
if (!this.$clickSelection) this.selection.selectToPosition(pos)
this.selection.setSelectionAnchor(pos.row, pos.column); else {
this.moveCursorToPosition(pos);
if (!this.$clickSelection)
this.selection.clearSelection(pos.row, pos.column);
}
this.renderer.scrollCursorIntoView(); this.renderer.scrollCursorIntoView();