helix/helix-view/src/events.rs

37 lines
1011 B
Rust
Raw Normal View History

use helix_core::{ChangeSet, Rope};
2023-12-01 07:03:26 +08:00
use helix_event::events;
use helix_lsp::LanguageServerId;
2023-12-01 07:03:26 +08:00
use crate::{Document, DocumentId, Editor, ViewId};
2023-12-01 07:03:26 +08:00
events! {
DocumentDidOpen<'a> {
editor: &'a mut Editor,
doc: DocumentId
}
DocumentDidChange<'a> {
doc: &'a mut Document,
view: ViewId,
old_text: &'a Rope,
changes: &'a ChangeSet,
ghost_transaction: bool
}
DocumentDidClose<'a> {
editor: &'a mut Editor,
doc: Document
}
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 }
LanguageServerInitialized<'a> {
editor: &'a mut Editor,
server_id: LanguageServerId
}
LanguageServerExited<'a> {
editor: &'a mut Editor,
server_id: LanguageServerId
}
2023-12-01 07:03:26 +08:00
}