Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions codex-rs/tui/src/bottom_pane/chat_composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,15 @@ impl ChatComposer {

// Replace the slice `[start_idx, end_idx)` with the chosen path and a trailing space.
let mut new_text =
String::with_capacity(text.len() - (end_idx - start_idx) + path.len() + 1);
String::with_capacity(text.len() - (end_idx - start_idx) + path.len() + 2);
new_text.push_str(&text[..start_idx]);
new_text.push('@');
new_text.push_str(path);
new_text.push(' ');
new_text.push_str(&text[end_idx..]);

self.textarea.set_text(&new_text);
let new_cursor = start_idx.saturating_add(path.len()).saturating_add(1);
let new_cursor = start_idx.saturating_add(path.len()).saturating_add(2);
self.textarea.set_cursor(new_cursor);
}

Expand Down
Loading