From ff4c1d05deee2b4b4d85c29a627fb01e60886c7f Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 9 May 2021 18:13:50 +0900 Subject: Replace the Clear widget with buffer.clear/clear_with. --- helix-term/src/ui/prompt.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'helix-term/src/ui/prompt.rs') diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index b09b8e14..9bde1f57 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -126,13 +126,7 @@ impl Prompt { let area = completion_area; let background = theme.get("ui.statusline"); - for y in area.top()..area.bottom() { - for x in area.left()..area.right() { - let cell = surface.get_mut(x, y); - cell.reset(); - cell.set_style(background); - } - } + surface.clear_with(area, background); let mut row = 0; let mut col = 0; @@ -172,13 +166,7 @@ impl Prompt { ); let background = theme.get("ui.window"); - for y in area.top()..area.bottom() { - for x in area.left()..area.right() { - let cell = surface.get_mut(x, y); - cell.reset(); - cell.set_style(background); - } - } + surface.clear_with(area, background); use tui::layout::Margin; text.render( -- cgit v1.2.3-70-g09d2