File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments