diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index 3f2c24eea4..010c93bddb 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -805,7 +805,7 @@ impl ChatComposer { collaboration_mode_indicator_line(self.collaboration_mode_indicator, show_cycle_hint) { if !spans.is_empty() { - spans.push(" | ".dim().into()); + spans.push(" | ".dim()); } spans.extend(collab.spans); } @@ -820,7 +820,7 @@ impl ChatComposer { let mut line = context_window_line(self.context_window_percent, self.context_window_used_tokens); if let Some(vim_mode) = self.vim_mode_indicator_span() { - line.spans.push(" | ".dim().into()); + line.spans.push(" | ".dim()); line.spans.push(vim_mode); } line @@ -4440,7 +4440,7 @@ mod tests { assert!(composer.textarea.is_vim_enabled()); assert_eq!( composer.vim_mode_indicator_span(), - Some("Vim: Normal".yellow()) + Some("Vim: Normal".magenta()) ); composer.handle_key_event(KeyEvent::new(KeyCode::Char('i'), KeyModifiers::NONE)); @@ -4485,7 +4485,7 @@ mod tests { composer.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)); assert_eq!( composer.vim_mode_indicator_span(), - Some("Vim: Normal".yellow()) + Some("Vim: Normal".magenta()) ); } diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_esc_hint_from_overlay.snap.new b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_esc_hint_from_overlay.snap.new new file mode 100644 index 0000000000..0d13880cd9 --- /dev/null +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_esc_hint_from_overlay.snap.new @@ -0,0 +1,14 @@ +--- +source: tui/src/bottom_pane/chat_composer.rs +assertion_line: 4027 +expression: terminal.backend() +--- +" " +"› Ask Codex to do anything " +" " +" " +" " +" " +" " +" " +" esc esc to edit previous message 100% context left " diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_esc_hint_primed.snap.new b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_esc_hint_primed.snap.new new file mode 100644 index 0000000000..2004abf515 --- /dev/null +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_esc_hint_primed.snap.new @@ -0,0 +1,6 @@ +--- +source: tui/src/bottom_pane/footer.rs +assertion_line: 1179 +expression: terminal.backend() +--- +" esc again to edit previous message 100% context left " diff --git a/codex-rs/tui/src/bottom_pane/textarea.rs b/codex-rs/tui/src/bottom_pane/textarea.rs index a0f0289e46..d6fdbc5589 100644 --- a/codex-rs/tui/src/bottom_pane/textarea.rs +++ b/codex-rs/tui/src/bottom_pane/textarea.rs @@ -569,11 +569,10 @@ impl TextArea { } fn handle_vim_normal(&mut self, event: KeyEvent) { - if let Some(op) = self.vim_operator.take() { - if self.handle_vim_operator(op, event) { + if let Some(op) = self.vim_operator.take() + && self.handle_vim_operator(op, event) { return; } - } match event { KeyEvent { diff --git a/codex-rs/tui/src/public_widgets/composer_input.rs b/codex-rs/tui/src/public_widgets/composer_input.rs index f6aef474c7..506ae264c4 100644 --- a/codex-rs/tui/src/public_widgets/composer_input.rs +++ b/codex-rs/tui/src/public_widgets/composer_input.rs @@ -123,11 +123,8 @@ impl ComposerInput { } fn handle_slash_command(&mut self, cmd: SlashCommand) { - match cmd { - SlashCommand::Vim => { - self.inner.toggle_vim_enabled(); - } - _ => {} + if cmd == SlashCommand::Vim { + self.inner.toggle_vim_enabled(); } }