Format matches count the same as scroll percent

This commit is contained in:
Kovid Goyal 2018-06-16 08:24:32 +05:30
parent 35041e7709
commit 8b4fe494cf
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -303,7 +303,8 @@ def draw_status_line(self):
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 @@ def draw_status_line(self):
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)