feat: remove InsertChar action and inline character handling; streamline input processing and autocomplete triggers

This commit is contained in:
asepharyana
2026-07-12 12:02:45 +07:00
parent ac99835eb4
commit 55bcfda0d6
5 changed files with 16 additions and 22 deletions
+10 -1
View File
@@ -200,7 +200,16 @@ pub fn handle_key(key: KeyEvent, state: &mut AppStateRest) -> Vec<Action> {
state.input.close_autocomplete();
state.dirty = true;
}
vec![Action::InsertChar(c)]
// Insert the character inline so we can immediately check the
// new buffer state for autocomplete triggers.
state.input.insert(c);
state.dirty = true;
// Show autocomplete immediately when the buffer starts with `/`,
// without requiring an extra Tab press.
if state.input.buffer.starts_with('/') {
state.input.open_autocomplete();
}
Vec::new()
}
_ => Vec::new(),
}