From dcfceb5059e28913c1db196f7ed3c7b8ed680f38 Mon Sep 17 00:00:00 2001 From: Sofus Addington Date: Sun, 18 Aug 2024 21:44:22 +0200 Subject: [PATCH] Dispatch DocumentDidOpen on ls initialization --- helix-term/src/application.rs | 2 ++ helix-view/src/events.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 646a3397b..80f94d130 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -734,6 +734,8 @@ impl Application { doc.text(), language_id, )); + + helix_event::dispatch(helix_view::events::DocumentDidOpen { doc }); } } Notification::PublishDiagnostics(params) => { diff --git a/helix-view/src/events.rs b/helix-view/src/events.rs index 0d4b1c21c..3c1cd1c97 100644 --- a/helix-view/src/events.rs +++ b/helix-view/src/events.rs @@ -5,7 +5,7 @@ use crate::{Document, DocumentId, Editor, ViewId}; events! { DocumentDidChange<'a> { doc: &'a mut Document, view: ViewId, old_text: &'a Rope } - DocumentDidOpen<'a> { doc: &'a mut Document} + DocumentDidOpen<'a> { doc: &'a Document} SelectionDidChange<'a> { doc: &'a mut Document, view: ViewId } DiagnosticsDidChange<'a> { editor: &'a mut Editor, doc: DocumentId } }