Repository navigation
fix(view): tighten cursor-carry around rename aliases and refreshes - #379
Open
dlyongemallo wants to merge 1 commit into
Open
dlyongemallo wants to merge 1 commit into
dlyongemallo wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The review has no active issues requiring resolution.
No open issues 🎉
What changed in this PR
This PR refines cursor carry in file-history views so rename aliases, panel refreshes, and restored sessions handle fold reveal consistently.
Changes:
- Clear shared rename-alias cursor state when consumed or replaced.
- Distinguish same-commit refreshes from revision steps, and enable fold reveal when restoring a file-history session.
- Add regression tests and document the file-history fold-reveal opt-in.
| File | Description |
|---|---|
lua/diffview/tests/functional/session_spec.lua |
Expect fold reveal in restored cursor state. |
lua/diffview/tests/functional/cursor_carry_spec.lua |
Test alias cleanup and commit-aware revision-step detection. |
lua/diffview/session.lua |
Enable fold reveal for restored file-history cursor entries. |
lua/diffview/scene/views/standard/standard_view.lua |
Clean up shared cursor aliases and exclude same-commit refreshes from revision steps. |
lua/diffview/scene/views/file_history/file_history_view.lua |
Document the existing revision-step fold-reveal opt-in. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
restore_main_viewnow drops everycursor_mapkey pointing to the consumed state, not justpath. A rename step installs that state under bothpathand its alias; dropping only one let the other replay a stalerevealon a later plain file switch.snapshot_main_viewdrops any prior aliases atpathbefore the overwrite, so a cancelled rename step can't leavereveal=trueon an orphaned alias that the next step never names._is_revision_stepshort-circuits when the two entries share a commit hash. A panel refresh (R,FugitiveChanged) rebuilds everyFileEntry, so the same-commit reopen was being mistaken for a step forward.restore_file_history_entryreappliesrevealon every restored state so a resumed file-history browse still opens folds on the first open, matching live stepping. The sidecar schema stays bare.