Edit queued messages with Vim history-up (#38907)

## What changed

- When the composer is empty in Vim normal mode, make the configured history-up binding restore the latest queued follow-up for editing.
- Remove the restored message from the queue so submitting the edited version replaces it instead of creating a duplicate.
- Preserve normal history navigation when the composer has text or a popup is active, and honor remapped Vim bindings.

## Testing

- Add TUI tests covering repeated edit-and-requeue cycles and a remapped history-up binding.

GitOrigin-RevId: 0b04dd964d3fc6fdcd10712aa4d5fd81cbbd2255
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-08-16 21:48:41 +00:00
1 parent 6c108912ee
commit 2bc43d516e
4 files changed
+108 -2

No files matched your search

+12 -1
View File
@@ -110,7 +110,18 @@ impl ChatWidget {
}
if key_event.kind == KeyEventKind::Press
&& self.chat_keymap.edit_queued_message.is_pressed(key_event)
&& (self.chat_keymap.edit_queued_message.is_pressed(key_event)
|| (self.bottom_pane.composer_is_empty()
&& self
.bottom_pane
.keymap_contexts()
.contains(crate::keymap::KeymapContext::VimNormal)
&& self
.bottom_pane
.runtime_keymap()
.vim_normal
.move_up
.is_pressed(key_event)))
&& self.has_queued_follow_up_messages()
&& self.bottom_pane.no_modal_or_popup_active()
{