diff options
author | Blaž Hrastnik | 2020-12-22 07:48:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-22 07:48:34 +0000 |
commit | d61b4854b8da1cd8cc9d641526dedbd0be348640 (patch) | |
tree | 2ebcaed8df2aedeff29372308d8f19b02907fe09 /helix-term/src/ui | |
parent | 4749b39b88b3bedfd09c63fd332ece2b35c1ad3e (diff) |
Make sure to clear the whole screen with the background color.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 7 | ||||
-rw-r--r-- | helix-term/src/ui/picker.rs | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 35ef0c40..1bab2eef 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -39,6 +39,10 @@ impl EditorView { ) { let area = Rect::new(OFFSET, 0, viewport.width - OFFSET, viewport.height - 2); // - 2 for statusline and prompt self.render_buffer(view, area, surface, theme); + + // clear with background color + surface.set_style(viewport, theme.get("ui.background")); + let area = Rect::new(0, viewport.height - 2, viewport.width, 1); self.render_statusline(view, area, surface, theme); } @@ -51,9 +55,6 @@ impl EditorView { surface: &mut Surface, theme: &Theme, ) { - // clear with background color - surface.set_style(viewport, theme.get("ui.background")); - // TODO: inefficient, should feed chunks.iter() to tree_sitter.parse_with(|offset, pos|) let source_code = view.doc.text().to_string(); diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 4190e548..d4e4d46d 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -197,9 +197,12 @@ impl<T> Component for Picker<T> { // -- Render the frame: // clear area + let background = cx.editor.theme.get("ui.background"); for y in area.top()..area.bottom() { for x in area.left()..area.right() { - surface.get_mut(x, y).reset() + let cell = surface.get_mut(x, y); + cell.symbol.clear(); + cell.set_style(background); } } |