feat: remove InsertChar action and inline character handling; streamline input processing and autocomplete triggers
This commit is contained in:
+10
-1
@@ -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(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user