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

Commit 8960b69

Browse files
committed
don't retrieve tabSize pref until it's needed
1 parent 098d360 commit 8960b69

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/editor/Editor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,12 +878,15 @@ define(function (require, exports, module) {
878878
*/
879879
Editor.prototype.getColOffset = function (pos) {
880880
var line = this._codeMirror.getRange({line: pos.line, ch: 0}, pos),
881-
tabSize = Editor.getTabSize(),
881+
tabSize,
882882
column = 0,
883883
i;
884884

885885
for (i = 0; i < line.length; i++) {
886886
if (line[i] === '\t') {
887+
if (!tabSize) {
888+
tabSize = Editor.getTabSize();
889+
}
887890
column += (tabSize - (column % tabSize));
888891
} else {
889892
column++;

0 commit comments

Comments
 (0)