Skip to content

Commit 8d6f6e8

Browse files
committed
Check if we have visible ranges
1 parent 2a2292f commit 8d6f6e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/editor/EditorPlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ class SectionWordCountEditorPlugin implements PluginValue {
192192
return match ? match[1].length : null;
193193
};
194194

195+
if (!view.visibleRanges.length) return b.finish();
196+
195197
// Start processing from the beginning of the first visible range
196198
const { from } = view.visibleRanges[0];
197199
const doc = view.state.doc;

0 commit comments

Comments
 (0)