helix/helix-view/src/events.rs

19 lines
587 B
Rust
Raw Normal View History

use helix_core::{ChangeSet, Rope};
2023-12-01 07:03:26 +08:00
use helix_event::events;
use crate::{Document, DocumentId, Editor, ViewId};
2023-12-01 07:03:26 +08:00
events! {
DocumentDidChange<'a> {
doc: &'a mut Document,
view: ViewId,
old_text: &'a Rope,
changes: &'a ChangeSet,
ghost_transaction: bool
}
2023-12-01 07:03:26 +08:00
SelectionDidChange<'a> { doc: &'a mut Document, view: ViewId }
DiagnosticsDidChange<'a> { editor: &'a mut Editor, doc: DocumentId }
2024-03-04 06:20:30 +08:00
// called **after** a document loses focus (but not when its closed)
DocumentFocusLost<'a> { editor: &'a mut Editor, doc: DocumentId }
2023-12-01 07:03:26 +08:00
}