Skip to content

Commit

Permalink
Suppress no-op calls to replaceRange from indentLine
Browse files Browse the repository at this point in the history
Produces less noisy change objects when pressing enter.
  • Loading branch information
marijnh committed Aug 13, 2012
1 parent 47c8458 commit 6895f56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,8 @@ var CodeMirror = (function() {
for (var i = Math.floor(indentation / options.tabSize); i; --i) {pos += options.tabSize; indentString += "\t";}
while (pos < indentation) {++pos; indentString += " ";}

replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
if (indentString != curSpaceString)
replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
}

function loadMode() {
Expand Down

0 comments on commit 6895f56

Please sign in to comment.