From 7545d7170c2754f23c94cc8dc430221c56886343 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Tue, 2 Jun 2015 17:44:31 -0700 Subject: [PATCH] Add a background to the scrollbar Currently use the pipe character: | --- src/view/scroll.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/view/scroll.rs b/src/view/scroll.rs index 979c139..c881122 100644 --- a/src/view/scroll.rs +++ b/src/view/scroll.rs @@ -115,11 +115,12 @@ impl ScrollBase { // Now let start = steps * self.start_line / (1 + self.content_height - self.view_height); - printer.with_color( - if printer.focused { color::HIGHLIGHT } else { color::HIGHLIGHT_INACTIVE }, - |printer| { - printer.print_vline((printer.size.x-1, start), height, ' ' as u64); - }); + let color = if printer.focused { color::HIGHLIGHT } else { color::HIGHLIGHT_INACTIVE }; + + printer.print_vline((printer.size.x-1,0), printer.size.y, '|' as u64); + printer.with_color(color, |printer| { + printer.print_vline((printer.size.x-1, start), height, ' ' as u64); + }); } } }