mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
Provide a single gutter component that does breakpoint || diagnostic
This commit is contained in:
parent
d906911417
commit
84e939ef58
@ -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))
|
||||
})
|
||||
}
|
||||
|
@ -65,8 +65,7 @@ pub fn remove(&mut self, doc_id: &DocumentId) {
|
||||
}
|
||||
|
||||
const GUTTERS: &[(Gutter, usize)] = &[
|
||||
(gutter::breakpoints, 1),
|
||||
(gutter::diagnostic, 1),
|
||||
(gutter::diagnostics_or_breakpoints, 1),
|
||||
(gutter::line_number, 5),
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user