on master help sign in
Make sure to clear the whole screen with the background color.
commitd61b4854b8da1cd8cc9d641526dedbd0be348640 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 22 Dec 2020, 16:48 (6 years ago) parent4749b39
2 files changed+8−4
helix-term/src/ui/editor.rs+4−3 helix-term/src/ui/picker.rs+4−1
helix-term/src/ui/editor.rs+4−3
@@ -39,6 +39,10 @@ impl EditorView {
3939 ) {
4040 let area = Rect::new(OFFSET, 0, viewport.width - OFFSET, viewport.height - 2); // - 2 for statusline and prompt
4141 self.render_buffer(view, area, surface, theme);
42+
43+ // clear with background color
44+ surface.set_style(viewport, theme.get("ui.background"));
45+
4246 let area = Rect::new(0, viewport.height - 2, viewport.width, 1);
4347 self.render_statusline(view, area, surface, theme);
4448 }
@@ -51,9 +55,6 @@ impl EditorView {
5155 surface: &mut Surface,
5256 theme: &Theme,
5357 ) {
54− // clear with background color
55− surface.set_style(viewport, theme.get("ui.background"));
56−
5758 // TODO: inefficient, should feed chunks.iter() to tree_sitter.parse_with(|offset, pos|)
5859 let source_code = view.doc.text().to_string();
5960
helix-term/src/ui/picker.rs+4−1
@@ -197,9 +197,12 @@ impl<T> Component for Picker<T> {
197197 // -- Render the frame:
198198
199199 // clear area
200+ let background = cx.editor.theme.get("ui.background");
200201 for y in area.top()..area.bottom() {
201202 for x in area.left()..area.right() {
202− surface.get_mut(x, y).reset()
203+ let cell = surface.get_mut(x, y);
204+ cell.symbol.clear();
205+ cell.set_style(background);
203206 }
204207 }
205208