Skip to content

fix: start context folds closed and keep open ones open - #60

Merged
undont merged 16 commits into
mainfrom
fix/context-folds-start-closed
Sep 12, 2026
Merged

undont merged 16 commits into
mainfrom
fix/context-folds-start-closed

Conversation

@undont

@undont undont commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • a finite context value builds with folds closed. previously they were created open, only collapsing explicitly with zM, and every file switch reopened them
  • a fold you open stays open through a context size change, a layout toggle, a hunk revert and a re-read/re-render of the file, and comes back open when you return to its diff later within the same session
  • opened folds are tracked as the old/new line ranges of their unchanged runs, matched on whichever side's text is unchanged, so a re-read that adds, drops or moves hunks keeps the stretch you opened; the renderers' gap index got removed accordingly
  • when differ swaps the diff without you navigating (staging the last unstaged hunk, df on a staged diff, the watcher moving to the other pair), set_source gets keep_folds and carries the folds on screen
  • context accepts "full", now the default (math.huge still works); an invalid value warns and falls back to it
  • :Differ context and :Differ layout work from the file panel, where they reported "no diff view here"

closes #58

Test plan

  • make check clean

@undont
undont force-pushed the fix/context-folds-start-closed branch from 2baf48a to 0572301 Compare September 12, 2026 16:29
@undont
undont merged commit 99c96a0 into main Sep 12, 2026
11 checks passed
@undont
undont deleted the fix/context-folds-start-closed branch September 12, 2026 17:53
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.

feature request: preserve compact fold state when navigating diff files

1 participant