Skip to content

Commit

Permalink
Another iteration on pushing the selection forward on no-change reind…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
marijnh committed Nov 3, 2013
1 parent 01e9fbb commit dcf0b65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -2759,8 +2759,10 @@ window.CodeMirror = (function() {
for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
if (pos < indentation) indentString += spaceStr(indentation - pos);

if (indentString != curSpaceString || doc.sel.head.line == n && doc.sel.head.ch < curSpaceString.length)
if (indentString != curSpaceString)
replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
else if (doc.sel.head.line == n && doc.sel.head.ch < curSpaceString.length)
setSelection(doc, Pos(n, curSpaceString.length), Pos(n, curSpaceString.length), 1);
line.stateAfter = null;
}

Expand Down

0 comments on commit dcf0b65

Please sign in to comment.