From b388f291c8ddce3faf1918afc647d325dc116736 Mon Sep 17 00:00:00 2001 From: Jeffrey Fisher Date: Wed, 8 May 2013 22:49:48 -0700 Subject: [PATCH] Fix for issue 3723 - Tabbing on single-line character range should replace characters with tab --- src/editor/Editor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 9d9d9c07e16..6f9674cd885 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -119,8 +119,7 @@ define(function (require, exports, module) { // the proper indentation then indent it to the proper place. Otherwise, // add another tab. In either case, move the insertion point to the // beginning of the text. - // 2. If the selection is after the first non-space character, and is not an - // insertion point, indent the entire line(s). + // 2. If the selection is multi-line, indent all the lines. // 3. If the selection is after the first non-space character, and is an // insertion point, insert a tab character or the appropriate number // of spaces to pad to the nearest tab boundary. @@ -144,7 +143,7 @@ define(function (require, exports, module) { insertTab = true; to.ch = 0; } - } else if (instance.somethingSelected()) { + } else if (instance.somethingSelected() && from.line !== to.line) { CodeMirror.commands.indentMore(instance); } else { insertTab = true;