Skip to content

fix(compact): clear stale fold data when switching to new/untracked files#422

Open
marcomayer wants to merge 1 commit into
esmuellert:mainfrom
marcomayer:fix-compact-mode-folding-for-new-files
Open

fix(compact): clear stale fold data when switching to new/untracked files#422
marcomayer wants to merge 1 commit into
esmuellert:mainfrom
marcomayer:fix-compact-mode-folding-for-new-files

Conversation

@marcomayer

Copy link
Copy Markdown
Contributor

When compact mode is active and the user navigates to an untracked or newly added file (empty changes), reapply returned early without clearing visible_lines_by_win. The stale fold data from the previous file caused foldexpr to fold the entire new file.

Fix: Clear the window entries from visible_lines_by_win before the early return so foldexpr_eval returns "0" (unfoldable) for all lines. compact_mode stays true so compact re-engages on the next file with real diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant