Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #7193 from adobe/randy/perf-status-bar
Browse files Browse the repository at this point in the history
Typing performance improvement
  • Loading branch information
ingorichter committed Mar 18, 2014
2 parents 5bbbd4b + f41c78a commit 9f2c33a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,18 @@ define(function (require, exports, module) {
*/
Editor.prototype.getColOffset = function (pos) {
var line = this._codeMirror.getRange({line: pos.line, ch: 0}, pos),
tabSize = Editor.getTabSize(),
tabSize = null,
column = 0,
i;

for (i = 0; i < line.length; i++) {
if (line[i] === '\t') {
column += (tabSize - (column % tabSize));
if (tabSize === null) {
tabSize = Editor.getTabSize();
}
if (tabSize > 0) {
column += (tabSize - (column % tabSize));
}
} else {
column++;
}
Expand Down

0 comments on commit 9f2c33a

Please sign in to comment.