From cd0ebf4029da6b44a9d61d9e4197c1473e621840 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 11 Feb 2011 11:56:27 +0100 Subject: [PATCH] remove more manual cursor positioning --- lib/ace/editor.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index afef33ee..baeef892 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -367,7 +367,7 @@ var Editor =function(renderer, session) { return; if (!this.selection.isEmpty()) { - this.moveCursorToPosition(this.session.remove(this.getSelectionRange())); + this.session.remove(this.getSelectionRange()) this.clearSelection(); } }; @@ -542,7 +542,7 @@ var Editor =function(renderer, session) { if (this.selection.isEmpty()) { this.selection.selectRight(); } - this.moveCursorToPosition(this.session.remove(this.getSelectionRange())); + this.session.remove(this.getSelectionRange()) this.clearSelection(); }; @@ -553,7 +553,7 @@ var Editor =function(renderer, session) { if (this.selection.isEmpty()) this.selection.selectLeft(); - this.moveCursorToPosition(this.session.remove(this.getSelectionRange())); + this.session.remove(this.getSelectionRange()); this.clearSelection(); }; @@ -605,10 +605,7 @@ var Editor =function(renderer, session) { return; var rows = this.$getSelectedRows(); - this.selection.setSelectionAnchor(rows.last+1, 0); - this.selection.selectTo(rows.first, 0); - - this.session.remove(this.getSelectionRange()); + this.session.remove(new Range(rows.first, 0, rows.last+1, 0)); this.clearSelection(); };