mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
Apply ui.gutter style to empty gutters (#2032)
The unstyled column on the left from the diagnostics_or_breakpoints gutter looks sad if you want to add a background to all gutters. Let's fix this.
This commit is contained in:
parent
f3dcb4034f
commit
d5c0866978
@ -471,14 +471,20 @@ pub fn render_gutter(
|
|||||||
text.reserve(*width); // ensure there's enough space for the gutter
|
text.reserve(*width); // ensure there's enough space for the gutter
|
||||||
for (i, line) in (view.offset.row..(last_line + 1)).enumerate() {
|
for (i, line) in (view.offset.row..(last_line + 1)).enumerate() {
|
||||||
let selected = cursors.contains(&line);
|
let selected = cursors.contains(&line);
|
||||||
|
let x = viewport.x + offset;
|
||||||
|
let y = viewport.y + i as u16;
|
||||||
|
|
||||||
if let Some(style) = gutter(line, selected, &mut text) {
|
if let Some(style) = gutter(line, selected, &mut text) {
|
||||||
surface.set_stringn(
|
surface.set_stringn(x, y, &text, *width, gutter_style.patch(style));
|
||||||
viewport.x + offset,
|
} else {
|
||||||
viewport.y + i as u16,
|
surface.set_style(
|
||||||
&text,
|
Rect {
|
||||||
*width,
|
x,
|
||||||
gutter_style.patch(style),
|
y,
|
||||||
|
width: *width as u16,
|
||||||
|
height: 1,
|
||||||
|
},
|
||||||
|
gutter_style,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
text.clear();
|
text.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user