aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/gutter.rs16
-rw-r--r--helix-view/src/view.rs3
2 files changed, 17 insertions, 2 deletions
diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs
index 1ee84d43..7bc8d375 100644
--- a/helix-view/src/gutter.rs
+++ b/helix-view/src/gutter.rs
@@ -155,3 +155,19 @@ pub fn breakpoints<'doc>(
Some(style)
})
}
+
+pub fn diagnostics_or_breakpoints<'doc>(
+ editor: &'doc Editor,
+ doc: &'doc Document,
+ view: &View,
+ theme: &Theme,
+ is_focused: bool,
+ width: usize,
+) -> GutterFn<'doc> {
+ let diagnostics = diagnostic(editor, doc, view, theme, is_focused, width);
+ let breakpoints = breakpoints(editor, doc, view, theme, is_focused, width);
+
+ Box::new(move |line, selected, out| {
+ breakpoints(line, selected, out).or_else(|| diagnostics(line, selected, out))
+ })
+}
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 7a2d255a..9336742b 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -65,8 +65,7 @@ impl JumpList {
}
const GUTTERS: &[(Gutter, usize)] = &[
- (gutter::breakpoints, 1),
- (gutter::diagnostic, 1),
+ (gutter::diagnostics_or_breakpoints, 1),
(gutter::line_number, 5),
];