Skip to content

Commit

Permalink
fix indent removing text before cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Jul 11, 2016
1 parent 213e25a commit 80cf968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ace/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ var Editor = function(renderer, session) {
var indentString = lang.stringRepeat(" ", count);
} else {
var count = column % size;
while (line[range.start.column] == " " && count) {
while (line[range.start.column - 1] == " " && count) {
range.start.column--;
count--;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/ace/editor_text_edit_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ module.exports = {
var range = editor.getSelectionRange();
assert.position(range.start, 1, 7);
assert.position(range.end, 2, 7);

session.setValue(" x");
session.setOption("useSoftTabs", false);
editor.selection.moveTo(0, 3);
editor.indent();
assert.equal("\tx", session.toString());
},

"test: indent selected lines" : function() {
Expand Down

0 comments on commit 80cf968

Please sign in to comment.