From dd68dba6a9374de537b9cf76da8f62911a5fb2d3 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Tue, 20 Apr 2010 17:35:55 +0200 Subject: [PATCH] fix toggle line comments --- src/Editor.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Editor.js b/src/Editor.js index a7881fd7..77c81c4a 100644 --- a/src/Editor.js +++ b/src/Editor.js @@ -364,9 +364,18 @@ ace.Editor.prototype.blockOutdent = function(indentString) { }; ace.Editor.prototype.toggleCommentLines = function() { - if (this.selection.isEmpty()) return; + var rows = this._getSelectedRows(); - var range = this.getSelectionRange(); + var range = { + start: { + row: rows.first, + column: 0 + }, + end: { + row: rows.last, + column: 0 + } + }; var state = this.bgTokenizer.getState(this.getCursorPosition().row); var addedColumns = this.mode.toggleCommentLines(this.doc, range, state);