feat: Deteksi trigger @mention dan Tab-cycle di input handler
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
930961bd85
commit
2eebedfea5
@@ -7,6 +7,7 @@ use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
|||||||
use crate::app::mode;
|
use crate::app::mode;
|
||||||
use crate::app::runtime::actions::Action;
|
use crate::app::runtime::actions::Action;
|
||||||
use crate::app::runtime::commands::apply_command;
|
use crate::app::runtime::commands::apply_command;
|
||||||
|
use crate::app::state::misc::AutocompleteKind;
|
||||||
use crate::app::state::rest::AppStateRest;
|
use crate::app::state::rest::AppStateRest;
|
||||||
use crate::app::state::types::Overlay;
|
use crate::app::state::types::Overlay;
|
||||||
use crate::controller::command::parse_command;
|
use crate::controller::command::parse_command;
|
||||||
@@ -247,6 +248,11 @@ pub fn handle_key(key: KeyEvent, state: &mut AppStateRest) -> Vec<Action> {
|
|||||||
state.input.tab_complete();
|
state.input.tab_complete();
|
||||||
}
|
}
|
||||||
state.dirty = true;
|
state.dirty = true;
|
||||||
|
} else if state.input.autocomplete_kind == AutocompleteKind::FileMention
|
||||||
|
&& state.input.autocomplete_visible
|
||||||
|
{
|
||||||
|
state.input.cycle_autocomplete(true);
|
||||||
|
state.dirty = true;
|
||||||
}
|
}
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
@@ -263,6 +269,8 @@ pub fn handle_key(key: KeyEvent, state: &mut AppStateRest) -> Vec<Action> {
|
|||||||
// without requiring an extra Tab press.
|
// without requiring an extra Tab press.
|
||||||
if state.input.buffer.starts_with('/') {
|
if state.input.buffer.starts_with('/') {
|
||||||
state.input.open_autocomplete();
|
state.input.open_autocomplete();
|
||||||
|
} else if state.input.mention_query_at_cursor().is_some() {
|
||||||
|
state.input.open_mention_autocomplete(&state.mention_index.snapshot());
|
||||||
}
|
}
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user