mirror of
https://github.com/helix-editor/helix
synced 2026-11-25 15:40:26 +01:00
This is meant to be minimal for now and is expected to change as the config system evolves. Features like word completion should be able to hook into this to initialize or clear the word index when the toggle for the feature is turned on or off (respectively).
31 lines
1.1 KiB
Rust
31 lines
1.1 KiB
Rust
use helix_event::{events, register_event};
|
|
use helix_view::document::Mode;
|
|
use helix_view::events::{
|
|
ConfigDidChange, DiagnosticsDidChange, DocumentDidChange, DocumentDidClose, DocumentDidOpen,
|
|
DocumentFocusLost, LanguageServerExited, LanguageServerInitialized, SelectionDidChange,
|
|
};
|
|
|
|
use crate::commands;
|
|
use crate::keymap::MappableCommand;
|
|
|
|
events! {
|
|
OnModeSwitch<'a, 'cx> { old_mode: Mode, new_mode: Mode, cx: &'a mut commands::Context<'cx> }
|
|
PostInsertChar<'a, 'cx> { c: char, cx: &'a mut commands::Context<'cx> }
|
|
PostCommand<'a, 'cx> { command: & 'a MappableCommand, cx: &'a mut commands::Context<'cx> }
|
|
}
|
|
|
|
pub fn register() {
|
|
register_event::<OnModeSwitch>();
|
|
register_event::<PostInsertChar>();
|
|
register_event::<PostCommand>();
|
|
register_event::<DocumentDidOpen>();
|
|
register_event::<DocumentDidChange>();
|
|
register_event::<DocumentDidClose>();
|
|
register_event::<DocumentFocusLost>();
|
|
register_event::<SelectionDidChange>();
|
|
register_event::<DiagnosticsDidChange>();
|
|
register_event::<LanguageServerInitialized>();
|
|
register_event::<LanguageServerExited>();
|
|
register_event::<ConfigDidChange>();
|
|
}
|