feat(tui): support Ctrl+Backspace in text inputs

This commit is contained in:
objz committed 2026-07-28 16:46:15 +02:00
1 parent 315567a79c
commit cccf65981a
13 files changed
+99 -16

No files matched your search

@@ -235,7 +235,7 @@ fn handle_input_key(
match key_event.code {
KeyCode::Esc => state.step = ImportStep::Discover,
KeyCode::Backspace => {
state.input.pop();
crate::tui::widgets::search::backspace(&mut state.input, key_event.modifiers);
}
KeyCode::Enter => {
if state.input.trim().is_empty() {
@@ -273,7 +273,7 @@ fn handle_version_key(
return;
}
KeyCode::Backspace => {
state.version_search.pop();
state.version_search.backspace(key_event.modifiers);
clamp_version_index(state);
return;
}
+13 -1
View File
@@ -147,6 +147,18 @@ fn handle_name_key(
}
state.step = WizardStep::Loader;
}
KeyCode::Backspace
if key_event
.modifiers
.contains(crossterm::event::KeyModifiers::CONTROL) =>
{
let position = state.name_state.position();
let position = crate::tui::widgets::search::delete_previous_word(
state.name_state.value_mut(),
position,
);
*state.name_state.position_mut() = position;
}
_ => {
state.name_state.handle_key_event(*key_event);
}
@@ -167,7 +179,7 @@ fn handle_version_key(
return;
}
KeyCode::Backspace => {
state.version_search.pop();
state.version_search.backspace(key_event.modifiers);
clamp_version_index(state);
return;
}