diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index 1dd925bf61..47b01430de 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -171,7 +171,7 @@ impl App<'_> { scroll_event_helper.scroll_down(); } crossterm::event::Event::Paste(pasted) => { - // Many terminals convert newlines to \r when + // Many terminals convert newlines to \r when // pasting, e.g. [iTerm2][]. But [tui-textarea // expects \n][tui-textarea]. This seems like a bug // in tui-textarea IMO, but work around it for now. diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index 0c97bdd774..061c139220 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -17,13 +17,13 @@ use tui_textarea::TextArea; use super::chat_composer_history::ChatComposerHistory; use super::command_popup::CommandPopup; use super::file_search_popup::FileSearchPopup; -use crate::slash_command::SlashCommand; // for typing -use crate::at_command::{AtCommand, built_in_at_commands}; // for typing and lookup +use crate::slash_command::SlashCommand; +use crate::at_command::{AtCommand, built_in_at_commands}; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; use codex_file_search::FileMatch; -use std::path::Path; // added for image extension checks +use std::path::Path; const BASE_PLACEHOLDER_TEXT: &str = "send a message"; /// If the pasted content exceeds this number of characters, replace it with a @@ -777,7 +777,6 @@ impl ChatComposer<'_> { self.dismissed_file_popup_token = None; } - // NEW: Synchronize @-command popup. fn sync_at_command_popup(&mut self) { if matches!(self.active_popup, ActivePopup::Slash(_) | ActivePopup::File(_)) { return; } let (row, col) = self.textarea.cursor(); diff --git a/codex-rs/tui/src/bottom_pane/command_popup.rs b/codex-rs/tui/src/bottom_pane/command_popup.rs index c0e2f05643..3d106a620c 100644 --- a/codex-rs/tui/src/bottom_pane/command_popup.rs +++ b/codex-rs/tui/src/bottom_pane/command_popup.rs @@ -14,7 +14,7 @@ use ratatui::widgets::WidgetRef; use crate::slash_command::SlashCommand; use crate::slash_command::built_in_slash_commands; -use crate::at_command::{AtCommand, built_in_at_commands}; // NEW +use crate::at_command::{AtCommand, built_in_at_commands}; pub trait CommandInfo: Copy { fn command(&self) -> &'static str; @@ -36,7 +36,7 @@ const FIRST_COLUMN_WIDTH: u16 = 20; use ratatui::style::Modifier; -pub(crate) struct CommandPopup { // generic +pub(crate) struct CommandPopup { prefix: char, command_filter: String, all_commands: Vec<(&'static str, C)>, @@ -51,7 +51,7 @@ impl CommandPopup { /// Update the filter string based on the current composer text. The text /// passed in is expected to start with this popup's prefix (e.g. '/' or '@'). /// Everything after the prefix up to the first ASCII whitespace becomes - /// the active filter token. + /// the active filter that is used to narrow down the list of available commands. pub(crate) fn on_composer_text_change(&mut self, text: String) { let first_line = text.lines().next().unwrap_or(""); if first_line.starts_with(self.prefix) {