From 8b4fe494cfdcd67b2961f2622b886a9dc298ddc4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Jun 2018 08:24:32 +0530 Subject: [PATCH] Format matches count the same as scroll percent --- kittens/diff/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kittens/diff/main.py b/kittens/diff/main.py index 2961b4999..d44c12f00 100644 --- a/kittens/diff/main.py +++ b/kittens/diff/main.py @@ -303,7 +303,8 @@ class DiffHandler(Handler): elif self.state is MESSAGE: self.write(self.message) else: - scroll_frac = styled('{:.0%}'.format(self.scroll_pos / (self.max_scroll_pos or 1)), fg=self.opts.margin_fg) + sp = '{:.0%}'.format(self.scroll_pos/self.max_scroll_pos) if self.scroll_pos and self.max_scroll_pos else '0%' + scroll_frac = styled(sp, fg=self.opts.margin_fg) if self.current_search is None: counts = '{}{}{}'.format( styled(str(self.added_count), fg=self.opts.highlight_added_bg), @@ -311,7 +312,7 @@ class DiffHandler(Handler): styled(str(self.removed_count), fg=self.opts.highlight_removed_bg) ) else: - counts = '[{} matches]'.format(len(self.current_search)) + counts = styled('{} matches'.format(len(self.current_search)), fg=self.opts.margin_fg) suffix = counts + ' ' + scroll_frac prefix = styled(':', fg=self.opts.margin_fg) filler = self.screen_size.cols - wcswidth(prefix) - wcswidth(suffix)