Skip to content

Commit

Permalink
fix: avoid index out of bounds during temporary updates
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Oct 11, 2024
1 parent 590e5fa commit 4293171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function createPlainShiki(shiki: HighlighterCore) {
}

function tempUpdate(textLines: string[], start: number, end: number) {
if (end - start > 1) {
if (end - start > 1 || loadLines.length <= start) {
return;
}

Expand Down

0 comments on commit 4293171

Please sign in to comment.