Closed SuperBo closed 6 months ago
The windows are ordered chronologically (assuming left-to-right, top-to-bottom order). This means that you always get the older state first, followed by the newer state, which is intuitive.
What's the justification for arranging the layout in the inverse chronological order?
Let take a look at this screenshot.
In the file panel, top-to-bottom direction, we apply a reverse chronological. This means we have newer file first (unstaged) then older (staged).
However in the file window buffer, we apply a reverse order (chronological order). This means we have older file first (index) on the left, and newer file (working dir) on the right.
This inconsistent make me feel very strange at the first time I use Diffview.
The sections in the file panel are not ordered by chronology. They're ordered by urgency ("what requires the users attention first?"):
But this is unrelated to how the diff windows are arranged. Practically every tool that has a diff viewer displays diffs in chronological order, the same way we do in diffview.nvim. Off the top of my head I can think of:
If lazygit does something else here, they are clearly the outlier.
Anyway, you have now indirectly made the case for rearranging the sections in the file panel, which I'm willing to discuss. However, you haven't made an argument for why we should offer an option for arranging diff windows in reverse-chronological order.
I think you are correct, I have check other clients, all have the same arrangement with diffview.
My wrong impression really comes from this layout (unstaged changes are on the left, staged changes are in the right).
Actually these are two inline diff windows, not the same as side-by-side diff window.
For file panel, I have just take a look at Gitlense, they put staged changes before unstaged changes.
Closing as completed as at seems we came to an understanding with regards to the original issue.
If you think we should rearrange the sections in the file panel, please open a new issue with arguments for why think so, and we can discuss it further. Mind you, the arguments need to be more meaningful than "it's what VSCode does".
Description
Right now the current window order is putting index as following
the entries under "Changes" will have the index buffer on the left side, and the entries under "Staged changes" will have it on the right side)
Expected behavior
I came from lazygit experience, so I expect the with "Changes" files, the index should be in right and similar with "Staged", index should be in left.
Please allow one config option to let the user config the index buffer orientation.
Actual behavior
Index is put on fixed position without any option to configure.
Steps to reproduce
:DiffviewOpen
Health check
Output of
``` ####################### ### PUT OUTPUT HERE ### ####################### ```:checkhealth diffview
Log info
Relevant info from
``` ############################ ### PUT LOG CONTENT HERE ### ############################ ```:DiffviewLog
Neovim version
Operating system and version
macOS 14.0
Minimal config
No response