Skip to content

Commit 9fcbda4

Browse files
committed
Fix ignored blank lines
1 parent c0e2b55 commit 9fcbda4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/mixins/canvas-drawer.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,17 +695,19 @@ function drawLines(
695695
const editorTokensForScreenRow = editor.tokensForScreenRow(line)
696696
const numToken = editorTokensForScreenRow.length
697697
const numTokenToRender = Math.min(numToken, maxTokensInOneLine)
698+
699+
if (lastLine !== line) {
700+
x = 0
701+
y += lineHeight
702+
lastLine = line
703+
context.clearRect(x, y, canvasWidth, lineHeight)
704+
}
705+
698706
for (let iToken = 0; iToken < numTokenToRender; iToken++) {
699707
const token = editorTokensForScreenRow[iToken]
700708
const tokenText = token.text.replace(invisibleRegExp, " ")
701709
const tokenScopes = token.scopes
702710

703-
if (lastLine !== line) {
704-
x = 0
705-
y += lineHeight
706-
lastLine = line
707-
context.clearRect(x, y, canvasWidth, lineHeight)
708-
}
709711
if (x > canvasWidth) {
710712
continue
711713
}

0 commit comments

Comments
 (0)