on master help sign in
Make sure to clear the whole screen with the background color.
d61b485Blaž Hrastnik
helix-term/src/ui/editor.rs+4−3
@@ -39,6 +39,10 @@ impl EditorView {
39 ) {
39 ) {
40 let area = Rect::new(OFFSET, 0, viewport.width - OFFSET, viewport.height - 2); // - 2 for statusline and prompt
40 let area = Rect::new(OFFSET, 0, viewport.width - OFFSET, viewport.height - 2); // - 2 for statusline and prompt
41 self.render_buffer(view, area, surface, theme);
41 self.render_buffer(view, area, surface, theme);
42+
43+ // clear with background color
44+ surface.set_style(viewport, theme.get("ui.background"));
45+
42 let area = Rect::new(0, viewport.height - 2, viewport.width, 1);
46 let area = Rect::new(0, viewport.height - 2, viewport.width, 1);
43 self.render_statusline(view, area, surface, theme);
47 self.render_statusline(view, area, surface, theme);
44 }
48 }
@@ -51,9 +55,6 @@ impl EditorView {
51 surface: &mut Surface,
55 surface: &mut Surface,
52 theme: &Theme,
56 theme: &Theme,
53 ) {
57 ) {
54− // clear with background color
55− surface.set_style(viewport, theme.get("ui.background"));
56−
57 // TODO: inefficient, should feed chunks.iter() to tree_sitter.parse_with(|offset, pos|)
58 // TODO: inefficient, should feed chunks.iter() to tree_sitter.parse_with(|offset, pos|)
58 let source_code = view.doc.text().to_string();
59 let source_code = view.doc.text().to_string();
59
60
helix-term/src/ui/picker.rs+4−1
@@ -197,9 +197,12 @@ impl<T> Component for Picker<T> {
197 // -- Render the frame:
197 // -- Render the frame:
198
198
199 // clear area
199 // clear area
200+ let background = cx.editor.theme.get("ui.background");
200 for y in area.top()..area.bottom() {
201 for y in area.top()..area.bottom() {
201 for x in area.left()..area.right() {
202 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);
203 }
206 }
204 }
207 }
205
208