aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-05-01 00:47:53 +0000
committerSkyler Hawthorne2022-06-19 03:54:03 +0000
commit40120967e9ba48d2e8b5fb4976a6ca1ce8993704 (patch)
tree784f59fed20a32e3e2d0417a16f9c7b7f9db2889 /helix-view/src
parent07fc80aece221233b4a986b0c5a03e2056cc1307 (diff)
tests for buffer-close
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/editor.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index d828f9ec..e8603221 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -576,6 +576,15 @@ impl Editor {
self.status_msg.as_ref().map(|(status, sev)| (status, sev))
}
+ /// Returns true if the current status is an error
+ #[inline]
+ pub fn is_err(&self) -> bool {
+ self.status_msg
+ .as_ref()
+ .map(|(_, sev)| *sev == Severity::Error)
+ .unwrap_or(false)
+ }
+
pub fn set_theme(&mut self, theme: Theme) {
// `ui.selection` is the only scope required to be able to render a theme.
if theme.find_scope_index("ui.selection").is_none() {