Repository navigation
feat(rex): open files and the message in $EDITOR beside the pane - #7
Merged
Merged
Conversation
o opens the selected file, or the one in the diff, in $EDITOR at its first change. In Rex it opens in a new pane beside the biggest pane in the window, so rex-git keeps its width, and O opens it in a new tab. Ctrl+E opens the commit message in a pane the same way and takes the edited message back when the editor exits. Outside Rex both open in rex-git's own pane, as Ctrl+E did before.
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.
This is the second layer of four and sits on the zoom layer. To fix something you saw in a diff, you had to find the file in another pane and open it yourself.
Ctrl+Eopened the commit message in$EDITORinside rex-git's own narrow pane, which hid rex-git while you wrote.What changed
oopens the selected file, or the one in the diff, in$EDITORat its first change.oopens the editor in a new pane in the same window. The pane goes right of the biggest other pane, so rex-git keeps its width, and you can drag it anywhere.Oopens it in a new tab instead.Ctrl+Eopens the commit message in a pane the same way. The box shows "editing in $EDITOR…", and the edited message comes back when the editor exits.+Nto vi, vim, nvim, nano, emacs, kak, micro and mg, aspath:Nto helix and zed, and as-g path:Nto code, cursor and windsurf. Other editors just get the path.Ctrl+Edid before.Evidence
This is from a throwaway Rex session with a temp repo where line 4 of
f.txtchanged.EDITOR=vim, and the window has a shell at 70% and rex-git at 30%. Pane widths come fromrex session inspect.o:qOopened a second window holding only the editor. After:qthe session's active window was rex-git's again.The editor opened at the change:
Ctrl+Eafter typingfix: x, then:wqin the editor pane:With a body line added in vim, it came back with its lines:
When rex-git was alone in its window,
osplit rex-git's own pane and gave the editor 70%.cargo fmt --check,cargo clippy --all-targetsandcargo test(42 tests, includingeditor_commandsandfirst_changes) pass on this branch.Not checked: the fallback outside Rex, where the editor opens in rex-git's own pane, wasn't run by hand; it reuses the old
Ctrl+Ecode. GUI editors without a wait flag (codewithout-w) return at once, so the message comes back unchanged, as before.ELI5
Press
oon a changed file and your editor opens right next to the git panel, at the line that changed. When you close the editor, you're back where you were.