Repository navigation
EXC-1934 Toggle between unified and side-by-side diff - #40
Closed
macintacos wants to merge 7 commits into
Closed
macintacos wants to merge 7 commits into
macintacos wants to merge 7 commits into
Conversation
- unified_diff.view picks "unified" or "split"; split puts the base beside each tabpage's reading window, the two in diff mode - new split_diff module owns the base windows - previews and entering a file window move the pair
- a preview swap parks the base window for the next listed file - turning off closes every base window no view names - scrub a 'diff' that comes back with its buffer - closing a file window takes its base window with it - a restored session drops its empty gitsigns:// windows
- :Changeset diff split, <Plug>(changeset-diff-split) and <C-g>D switch the view for the session, turning the diff on when off - messages name the active view; the gitsigns warning and :checkhealth now say "the diff" - the reading window is never a floating window
- scrub forgets a buffer once its 'diff' is known off, leaving the user's own diffs alone - closing a file window alone with its base window no longer aborts with E855; the base window closes just after - session restore resets a leftover foldmethod=diff - a file compared against the index stays unified: its base buffer writes back to the index - :Changeset diff split from off turns the diff on side by side - one named rule says when a parked base window lives
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.
Part of: EXC-1934
Change Kind: new feature
What changed
The diff can now be drawn side by side as well as unified.
:Changeset diff split(<C-g>D,<Plug>(changeset-diff-split)) switches the whole branch between the two views for the session, and the newunified_diff.viewoption picks the view a session starts in, unified when unset. Vim's diff mode belongs to the tabpage, so only the window you are reading gets the base | file pair, and every other window there stays unified. Files new since the base, files gitsigns is still comparing against the index, and tabpages holding a diff of your own also stay unified.What to test
<C-g>D: the window you are reading gets its base in a window on its left, both in diff mode, and messages say "side-by-side diff on". Press it again to go back to unified.jin the sidebar in split mode: the base window follows the preview without opening and closing a window per row, andqleaves no base window or stray'diff'behind.:diffsplitor:Gitsigns diffthison a file the pair covered earlier: changeset leaves your diff alone.