aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-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() {