mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fix a few comments/imports
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<C: CommandInfo> { // generic
|
||||
pub(crate) struct CommandPopup<C: CommandInfo> {
|
||||
prefix: char,
|
||||
command_filter: String,
|
||||
all_commands: Vec<(&'static str, C)>,
|
||||
@@ -51,7 +51,7 @@ impl<C: CommandInfo> CommandPopup<C> {
|
||||
/// 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) {
|
||||
|
||||
Reference in New Issue
Block a user