Refresh Story Bible reference ranges when the header folds or unfolds
Folding/unfolding the header moves the frontmatter in or out of `buffer`, shifting every char offset into it, but after_view_change() never recomputed current_references — so the cached ranges stayed pointing at pre-toggle positions and highlights landed on unrelated words. Recompute them alongside the other view-state invalidations it already does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -541,6 +541,11 @@ impl App {
|
|||||||
self.spell_menu = None;
|
self.spell_menu = None;
|
||||||
self.clear_lt();
|
self.clear_lt();
|
||||||
self.autocomplete = None;
|
self.autocomplete = None;
|
||||||
|
// Story Bible reference ranges are char offsets into `buffer` too —
|
||||||
|
// stale ones (from before the header moved in or out) land on
|
||||||
|
// whatever text now happens to sit `header.len()` characters away
|
||||||
|
// from the real mention.
|
||||||
|
self.update_current_references();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How many header fields are hidden right now, for the toggle's label.
|
/// How many header fields are hidden right now, for the toggle's label.
|
||||||
|
|||||||
Reference in New Issue
Block a user