Skip to content

Commit

Permalink
Merge pull request #813 from mzivic7/fix_blank_line
Browse files Browse the repository at this point in the history
Fix blank lines being ignored
  • Loading branch information
aminya authored Oct 28, 2024
2 parents c0e2b55 + 56f1687 commit 55460b3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ npm-debug.log
node_modules
.live-archive
pages
dist
.parcel-cache
package-lock.json
package-lock.json
3 changes: 2 additions & 1 deletion dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/minimap-plugin-generator-element.68264bbd.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/minimap-plugin-generator-element.68264bbd.js.map

This file was deleted.

5 changes: 5 additions & 0 deletions dist/minimap-plugin-generator-element.f5282bf9.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/minimap-plugin-generator-element.f5282bf9.js.map

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,17 +695,19 @@ function drawLines(
const editorTokensForScreenRow = editor.tokensForScreenRow(line)
const numToken = editorTokensForScreenRow.length
const numTokenToRender = Math.min(numToken, maxTokensInOneLine)

if (lastLine !== line) {
x = 0
y += lineHeight
lastLine = line
context.clearRect(x, y, canvasWidth, lineHeight)
}

for (let iToken = 0; iToken < numTokenToRender; iToken++) {
const token = editorTokensForScreenRow[iToken]
const tokenText = token.text.replace(invisibleRegExp, " ")
const tokenScopes = token.scopes

if (lastLine !== line) {
x = 0
y += lineHeight
lastLine = line
context.clearRect(x, y, canvasWidth, lineHeight)
}
if (x > canvasWidth) {
continue
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"fs-plus": false
},
"outputFormat": "commonjs",
"isLibrary": true
"isLibrary": true,
"optimize": true
}
},
"viewProviders": [
Expand Down

0 comments on commit 55460b3

Please sign in to comment.