Skip to content

Commit ce22ba8

Browse files
committed
fix: editor image decorations replaced by the first one on scroll gradually
1 parent 3711e23 commit ce22ba8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/hooks/useEditor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ export const useEditor = create<EditorStore>((set, get) => ({
249249
}[] = [];
250250

251251
lines.forEach((line, index) => {
252+
if (index < editor.getVisibleRanges()[0].startLineNumber - 1) {
253+
return;
254+
}
255+
252256
const match = [...line.matchAll(MATCH_ASSET_URL_REGEX)]?.[0];
253257
const url = match?.[1];
254258

0 commit comments

Comments
 (0)