-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Summary
When view_mode = "tree" and flatten_dirs = true, staging or unstaging nested entries with s causes the explorer to rebuild the same path with a different flattened shape across groups.
Reproduction
- Create a repo with modified files in nested paths, for example:
src/alpha/one/a.txtsrc/alpha/one/b.txtsrc/alpha/two/c.txtsrc/beta/gamma/d.txtdocs/guide/readme.md
- Open
:CodeDiffwith tree view enabled. - In
Changes, move tosrc/alpha/oneand presss. - Observe the explorer.
- In
Staged Changes, move tosrc/alpha/oneand presssagain.
Actual
After staging, the same directory hierarchy is flattened differently across groups. For example:
Changesshowssrcwithalpha/twounder itStaged Changesshowssrc/alpha/oneas a single flattened top-level node
The hierarchy jumps as files move between Changes and Staged Changes.
Expected
The explorer tree should keep a stable directory shape when entries move between groups.
I put together an AI-generated fix here: #328
Environment
- codediff.nvim commit:
93cd80c56f71af4671388c568a37d4c84c3ddefa - Neovim:
v0.11.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels