fix: preserve selector text input and close on escape

This commit is contained in:
Valdemar Lorenzen
2026-10-12 13:08:56 +02:00
parent 684ba46a2c
commit 7bc5eab22f
9 changed files with 189 additions and 124 deletions
+8 -6
View File
@@ -4833,10 +4833,6 @@ mod tests {
diff.handle(Input::Enter);
render_diff(&mut terminal, &diff, &mut panels);
assert!(screen_text(&terminal).contains("Choose After · Before: commit-19"));
diff.handle(Input::Escape);
render_diff(&mut terminal, &diff, &mut panels);
assert!(screen_text(&terminal).contains("> needle"));
assert!(screen_text(&terminal).contains("> commit-19"));
diff.handle(Input::Ctrl('u'));
diff.handle(Input::Char('\t'));
render_diff(&mut terminal, &diff, &mut panels);
@@ -5649,7 +5645,6 @@ mod tests {
fn floating_inputs_share_workspace_geometry_across_documents_splits_and_diffs() {
for context in ["document", "split", "diff", "split-diff", "selector"] {
for prefix in [':', '/'] {
// A selector's slash belongs to its revision filter, not native search.
if context == "selector" && prefix == '/' {
continue;
}
@@ -5670,7 +5665,14 @@ mod tests {
editor.apply_diff_result(id, Ok(crate::diff::Outcome::Catalog(diff_catalog())));
}
editor.set_message("saved notification");
editor.handle(Input::Char(prefix));
if context == "selector" {
editor
.bind("normal", "ctrl+t", Some("core.command".into()))
.unwrap();
editor.handle(Input::Ctrl('t'));
} else {
editor.handle(Input::Char(prefix));
}
let query = format!("{}TAIL", "界e\u{301}👩‍🚀".repeat(30));
for ch in query.chars() {
editor.handle(Input::Char(ch));