helix/helix-term/src/events.rs

26 lines
899 B
Rust
Raw Normal View History

2023-12-01 00:03:26 +01:00
use helix_event::{events, register_event};
use helix_view::document::Mode;
2024-03-03 23:20:30 +01:00
use helix_view::events::{
2024-12-27 11:26:59 +01:00
DiagnosticsDidChange, DocumentDidChange, DocumentDidOpen, DocumentFocusLost, SelectionDidChange,
2024-03-03 23:20:30 +01:00
};
2023-12-01 00:03:26 +01:00
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::<DocumentDidChange>();
2024-12-27 11:26:59 +01:00
register_event::<DocumentDidOpen>();
2024-03-03 23:20:30 +01:00
register_event::<DocumentFocusLost>();
2023-12-01 00:03:26 +01:00
register_event::<SelectionDidChange>();
register_event::<DiagnosticsDidChange>();
2023-12-01 00:03:26 +01:00
}