Skip to content

feat(tui): open the reviewed file in $EDITOR with o and reload on return - #114

Merged
backnotprop merged 1 commit into
mainfrom
feat/open-in-editor
Oct 27, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/open-in-editor

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Answers plannotator/herdr-annotate#51 with a smaller feature: instead of editing inside the annotate pane, o opens the reviewed file in your own editor and reloads it when you come back.

  • New rebindable action open-in-editor, default o (unused in every context; it sits in the global browse keys, so the keymap conflict check covers it).
  • Uses $VISUAL, then $EDITOR; values with arguments work (code -w, nvim -u x, quoted paths). If neither is set, the footer says to set $EDITOR.
  • File and folder reviews only. Reply and terminal reviews have no file, so the key just shows a short status.
  • The TUI leaves the alternate screen and turns off raw mode, mouse capture, bracketed paste and the kitty keyboard flags. The editor then runs blocking in the same terminal, and all of that is restored afterwards. vim/nvim/nano/hx/emacs/micro/kak open at the current line via +N.
  • If the file changed, it reloads the same way r does, 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 EDITOR script that recorded its argv and the terminal state, then edited the file. While the editor ran: +5 was 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 real vim -u NONE at the selected line, /usr/bin/true followed by a later external save (the hint appears and r reloads), no editor set, and a missing editor binary.

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
@backnotprop
backnotprop added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit fd46de0 Oct 27, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/open-in-editor branch October 27, 2026 18:43
@backnotprop backnotprop mentioned this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant