Skip to content

Commit

Permalink
fix: Do not try apply highlight indent guide if the file is empty (#4928
Browse files Browse the repository at this point in the history
)
  • Loading branch information
andrewnester committed Sep 20, 2022
1 parent 4ad83b4 commit a90ef27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/layer/text.js
Expand Up @@ -436,6 +436,8 @@ var Text = function(parentEl) {
dir: undefined
};
var lines = this.session.doc.$lines;
if (!lines) return;

var cursor = this.session.selection.getCursor();
var initialIndent = /^\s*/.exec(this.session.doc.getLine(cursor.row))[0].length;
var elementIndentLevel = Math.floor(initialIndent / this.tabSize);
Expand Down

0 comments on commit a90ef27

Please sign in to comment.