aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/editor.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 83208f78..e9f027f3 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -7,12 +7,16 @@ use slotmap::SlotMap;
use anyhow::Error;
+pub use helix_core::diagnostic::Severity;
+
pub struct Editor {
pub tree: Tree,
pub documents: SlotMap<DocumentId, Document>,
pub count: Option<usize>,
pub theme: Theme,
pub language_servers: helix_lsp::Registry,
+
+ pub status_msg: Option<(String, Severity)>,
}
#[derive(Copy, Clone)]
@@ -43,9 +47,18 @@ impl Editor {
count: None,
theme,
language_servers,
+ status_msg: None,
}
}
+ pub fn set_status(&mut self, status: String) {
+ self.status_msg = Some((status, Severity::Info));
+ }
+
+ pub fn set_error(&mut self, error: String) {
+ self.status_msg = Some((error, Severity::Error));
+ }
+
fn _refresh(&mut self) {
for (view, _) in self.tree.views_mut() {
let doc = &self.documents[view.doc];