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

Commit 9f2c33a

Browse files
committed
Merge pull request #7193 from adobe/randy/perf-status-bar
Typing performance improvement
2 parents 5bbbd4b + f41c78a commit 9f2c33a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/editor/Editor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,18 @@ define(function (require, exports, module) {
884884
*/
885885
Editor.prototype.getColOffset = function (pos) {
886886
var line = this._codeMirror.getRange({line: pos.line, ch: 0}, pos),
887-
tabSize = Editor.getTabSize(),
887+
tabSize = null,
888888
column = 0,
889889
i;
890890

891891
for (i = 0; i < line.length; i++) {
892892
if (line[i] === '\t') {
893-
column += (tabSize - (column % tabSize));
893+
if (tabSize === null) {
894+
tabSize = Editor.getTabSize();
895+
}
896+
if (tabSize > 0) {
897+
column += (tabSize - (column % tabSize));
898+
}
894899
} else {
895900
column++;
896901
}

0 commit comments

Comments
 (0)