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

Commit 3803e25

Browse files
committed
safer way to check if tabSize pref has been retrieved
1 parent 8960b69 commit 3803e25

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/editor/Editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,13 @@ 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,
881+
tabSize = null,
882882
column = 0,
883883
i;
884884

885885
for (i = 0; i < line.length; i++) {
886886
if (line[i] === '\t') {
887-
if (!tabSize) {
887+
if (tabSize === null) {
888888
tabSize = Editor.getTabSize();
889889
}
890890
column += (tabSize - (column % tabSize));

0 commit comments

Comments
 (0)