Add Neovim floating chat input (:Augment chat-input)#66
Conversation
Add a new range-aware :Augment chat-input subcommand that opens a centered floating window with a markdown scratch buffer for composing a chat message. Submitting joins the buffer lines, closes the float, restores the prior mode (re-selecting a visual range via gv so the selection is passed through), and dispatches to the existing chat flow. The floating window is Neovim-only (nvim_open_win). In Vim, the command falls back to the standard input() prompt used by :Augment chat, with no change to existing behavior. No third-party dependencies and no default mappings are added. Buffer-local mappings: <C-s> (insert/normal) and <CR> (normal) submit; <Esc> (normal) and <C-c> (insert/normal) cancel. Update the command completion list, README.md, doc/augment.txt, and CHANGELOG.md.
|
👋 I've got this PR — here's what I'll handle for you:
Marking it ready and picking reviewers are your call — I'll leave both alone. Drop a comment anytime! Note: opened under @mgmonteleone's identity — the org bot lacks PR write access on this repo, so attribution may differ from other automated PRs. |
|
✅ Ready for review on
Reviewer pick is your call — I won't request anyone myself. I'll respond to any review feedback as it comes in (no merge — that stays a human gate). |
|
Minor UX thought: if the user switches out of the float (e.g. |
|
Good call on the orphaned-float UX. Implemented in Updated the README and |
Closes #61.
What
Adds a new range-aware
:Augment chat-inputsubcommand that opens a centered floating window with a markdown scratch buffer for composing a chat message before sending it. This upstreams a dependency-free, Neovim-gated version of the floating input the issue author shared (their LazyVim gist), reusing the existing chat plumbing.Behavior
nvim_open_winwith a scratch buffer (buftype=nofile,bufhidden=wipe), markdown filetype, opened in insert mode.<C-s>(insert/normal) or<CR>(normal) joins the buffer lines, closes the float, and dispatches to the existing chat flow.<Esc>(normal) or<C-c>(insert/normal) closes the float without sending.:Augment chat, invoking from visual mode (or with a range) includes the selected text. On submit the prior visual selection is restored viagvso it is passed through to the chat request.input()prompt used by:Augment chat, with no change to existing behavior.Changes
autoload/augment.vim—s:CommandChatInputhandler +s:ChatInputSubmitcallback; wired into command dispatch and completion.autoload/augment/chat.vim—augment#chat#OpenInputWindowplus submit/cancel helpers and buffer-local mappings.README.md,doc/augment.txt,CHANGELOG.md— document the new command.Validation
nvim --headless): verifies the function and completion entry exist, the float opens with a markdown buffer, a multi-line submit invokes the callback with the joined message and closes the window, and cancel closes the window without firing the callback. Result:SMOKE_OK.Pull Request opened by Augment Code | View session