mirror of https://github.com/helix-editor/helix
remove old document open/close events
parent
2d16a86c4c
commit
60c0882fd2
|
@ -17,7 +17,7 @@ use helix_view::{
|
|||
GutterConfig, IndentGuidesConfig, LineEndingConfig, LineNumber, LspConfig, SearchConfig,
|
||||
SmartTabConfig, StatusLineConfig, TerminalConfig, WhitespaceConfig,
|
||||
},
|
||||
events::{DocumentFocusLost, DocumentOpened, SelectionDidChange},
|
||||
events::{DocumentDidOpen, DocumentFocusLost, SelectionDidChange},
|
||||
extension::document_id_to_usize,
|
||||
input::KeyEvent,
|
||||
theme::Color,
|
||||
|
@ -2198,7 +2198,7 @@ fn register_hook(event_kind: String, callback_fn: SteelVal) -> steel::UnRecovera
|
|||
"document-opened" => {
|
||||
// TODO: Share this code with the above since most of it is
|
||||
// exactly the same
|
||||
register_hook!(move |event: &mut DocumentOpened<'_>| {
|
||||
register_hook!(move |event: &mut DocumentDidOpen<'_>| {
|
||||
let cloned_func = rooted.value().clone();
|
||||
let doc_id = event.doc;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ use helix_event::{events, register_event};
|
|||
use helix_view::document::Mode;
|
||||
use helix_view::events::{
|
||||
DiagnosticsDidChange, DocumentDidChange, DocumentDidClose, DocumentDidOpen, DocumentFocusLost,
|
||||
DocumentOpened, LanguageServerExited, LanguageServerInitialized, SelectionDidChange,
|
||||
LanguageServerExited, LanguageServerInitialized, SelectionDidChange,
|
||||
};
|
||||
|
||||
use crate::commands;
|
||||
|
@ -24,7 +24,6 @@ pub fn register() {
|
|||
register_event::<DocumentFocusLost>();
|
||||
register_event::<SelectionDidChange>();
|
||||
register_event::<DiagnosticsDidChange>();
|
||||
register_event::<DocumentOpened>();
|
||||
register_event::<LanguageServerInitialized>();
|
||||
register_event::<LanguageServerExited>();
|
||||
}
|
||||
|
|
|
@ -5,10 +5,7 @@ use crate::{
|
|||
DocumentOpenError, DocumentSavedEvent, DocumentSavedEventFuture, DocumentSavedEventResult,
|
||||
Mode, SavePoint,
|
||||
},
|
||||
events::{
|
||||
DocumentClosed, DocumentDidClose, DocumentDidOpen, DocumentFocusLost, DocumentOpened,
|
||||
DocumentSaved,
|
||||
},
|
||||
events::{DocumentDidClose, DocumentDidOpen, DocumentFocusLost, DocumentSaved},
|
||||
graphics::{CursorKind, Rect},
|
||||
handlers::Handlers,
|
||||
info::Info,
|
||||
|
@ -1896,10 +1893,6 @@ impl Editor {
|
|||
|
||||
self._refresh();
|
||||
|
||||
dispatch(DocumentClosed {
|
||||
editor: self,
|
||||
doc: doc_id,
|
||||
});
|
||||
helix_event::dispatch(DocumentDidClose { editor: self, doc });
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -24,8 +24,6 @@ events! {
|
|||
DiagnosticsDidChange<'a> { editor: &'a mut Editor, doc: DocumentId }
|
||||
// called **after** a document loses focus (but not when its closed)
|
||||
DocumentFocusLost<'a> { editor: &'a mut Editor, doc: DocumentId }
|
||||
DocumentOpened<'a> { editor: &'a mut Editor, doc: DocumentId }
|
||||
DocumentClosed<'a> { editor: &'a mut Editor, doc: DocumentId }
|
||||
DocumentSaved<'a> { editor: &'a mut Editor, doc: DocumentId }
|
||||
|
||||
LanguageServerInitialized<'a> {
|
||||
|
|
Loading…
Reference in New Issue