Skip to content

Commit

Permalink
fix(vscode): avoid language server crash when inserting new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 30, 2024
1 parent 8b1ae7f commit cabb6c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vscode/language-server/languagePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function* getEmbeddedCodes(parsed: SlidevMarkdown): Generator<VirtualCode> {
function lineToPos(line: number) {
let pos = 0
for (let i = 0; i <= line; i++) {
if (!lines[i])
break
pos += lines[i].length + 1
}
return pos
Expand Down

0 comments on commit cabb6c3

Please sign in to comment.