remove unecessary changes

This commit is contained in:
pap
2025-08-09 16:42:34 +01:00
parent e93ca9fa11
commit 194dc82c93
3 changed files with 12 additions and 55 deletions

View File

@@ -712,19 +712,21 @@ impl ChatComposer {
/// Synchronize `self.file_search_popup` with the current text in the textarea.
/// Note this is only called when self.active_popup is NOT Command.
fn sync_file_search_popup(&mut self) {
// Determine current query (may be empty if user just selected @file and hasn't typed yet).
let query_opt = Self::current_at_token(&self.textarea);
let Some(query) = query_opt else {
// Token removed end session.
self.active_popup = ActivePopup::None;
self.dismissed_file_popup_token = None;
return;
// Determine if there is an @token underneath the cursor.
let query = match Self::current_at_token(&self.textarea) {
Some(token) => token,
None => {
self.active_popup = ActivePopup::None;
self.dismissed_file_popup_token = None;
return;
}
};
// If user dismissed popup for this exact query, don't reopen until text changes.
if self.dismissed_file_popup_token.as_ref() == Some(&query) {
return;
}
if !query.is_empty() {
self.app_event_tx
.send(AppEvent::StartFileSearch(query.clone()));