Repository navigation
Close views with q everywhere and swap views in one tab - #23
Merged
Merged
Conversation
q in the commit panel now closes the whole view, the same as q in the diff panes, and :DiffBanditClose does it from the command line. gzp toggles the panel in 2-way diffs, and the session close key is configurable via navigation.close_key. Closing a view saves an unfinished commit message for the repository; the next panel opened there restores it, and committing clears it. Closed hosts delete their panel buffers so a modified commit buffer no longer blocks :qa with E37. Moving the panel selection between a merge conflict and a changed file now closes the previous view instead of leaving its tab behind. Fixes #20 Fixes #22
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.
Fixes #22 and fixes #20.
Closing (#22)
The X in the reporter's screenshot is Neovim's default tabline close button. It appears only with the stock tabline and two or more tabs, so it isn't a dependable way to close a view, and nothing in DiffBandit pointed to
q.qin the commit panel now closes the whole view (diff, merge resolver, or standalone panel). Before, it only hid the panel inside a diff, whileqin the diff panes closed everything.:DiffBanditClosecommand andrequire("diffbandit").close().gzpshows or hides the panel in 2-way diffs, from the panes or the panel, matching merge. Hiding a focused panel returns focus to a diff pane.navigation.close_key(defaultq,falsedisables it).:qafail with E37.panel.close) only hides now. It used to close the whole session in review mode, butqcalls the host's close directly.One tab when switching files (#20)
Moving the panel selection between a merge conflict and a changed file started a new host in a new tab and left the old one open. Now the new view opens first, then the old one closes. If the new view fails to open, the old one stays. Unsaved edits in a merge result are kept, because closing hides that buffer rather than deleting it.
Tests
20_git_merge: changed file → conflict → changed file keeps the tab count and disposes the old views. Also coversgzpin both directions,qfrom the panel, and saving, restoring and clearing the draft.15_running::DiffBanditClosecloses a session tab and returns to the original tab, closes a standalone panel, and does nothing when no view is open.25_launcher: outside launcher mode,qin the panel closes the tab; in launcher mode it still quits nvim.nvim --headless -u tests/run.luapasses.