Repository navigation
feat(tui): open the reviewed file in $EDITOR with o and reload on return - #114
Merged
Merged
Conversation
o (open-in-editor, rebindable) suspends the screen, runs $VISUAL or $EDITOR on the open file at the current line where the editor takes +N, and reloads the file when it changed so notes re-anchor. File and folder reviews only. refs plannotator/herdr-annotate#51
Merged
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.
Answers plannotator/herdr-annotate#51 with a smaller feature: instead of editing inside the annotate pane,
oopens the reviewed file in your own editor and reloads it when you come back.open-in-editor, defaulto(unused in every context; it sits in the global browse keys, so the keymap conflict check covers it).$VISUAL, then$EDITOR; values with arguments work (code -w,nvim -u x, quoted paths). If neither is set, the footer says to set$EDITOR.+N.rdoes, so notes re-anchor. If it did not change (for example a GUI editor without its wait flag), nothing reloads and the existing "File changed on disk. Press r to reload." hint covers the later save.Nothing changes for users who don't press the key.
Smoke-tested in tmux with an
EDITORscript that recorded its argv and the terminal state, then edited the file. While the editor ran:+5was passed, the tty was cooked (icanon/echo/isig) and alternate screen, mouse and paste were all off. Afterwards they were all back on, the file had reloaded and both notes re-anchored with 0 orphaned. I also checked a realvim -u NONEat the selected line,/usr/bin/truefollowed by a later external save (the hint appears andrreloads), no editor set, and a missing editor binary.