Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ function getDecorations(
// Find the start of the first change to limit traversal scope.
// We only need to check from the change point forward, since earlier
// blocks are unaffected and their mapped decorations remain correct.
const range = tr.changedRange();
if (!range) {
return { decorations: nextDecorationSet };
}
// On init (no steps), changedRange() returns null — fall back to a
// full scan so initial content gets indexed.
const range = tr.changedRange() ?? { from: 0, to: tr.doc.nodeSize - 2 };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewlipski besides init, wouldn't this now also fire on selection changes? e.g. if there have been no updates at all?

const decorationsToAdd = [] as Deco[];

// Track blockGroups where we've verified a decoration match past the
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading