1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-07 21:56:04 +02:00

Make sure to clear the whole screen with the background color.

This commit is contained in:
Blaž Hrastnik 2020-12-22 16:48:34 +09:00
parent 4749b39b88
commit d61b4854b8
2 changed files with 8 additions and 4 deletions

View File

@ -39,6 +39,10 @@ pub fn render_view(
) {
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 @@ pub fn render_buffer(
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();

View File

@ -197,9 +197,12 @@ fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
// -- 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);
}
}