Truncate listing titles on the left side.
- Better to retain the file name than the directory.
This commit is contained in:
parent
9f44030bb9
commit
a0892616bf
1 changed files with 6 additions and 4 deletions
|
|
@ -401,12 +401,14 @@ class Border:
|
|||
if self.title is None:
|
||||
title_bar = self.top * content_width
|
||||
else:
|
||||
padded_title = (" " + self.title + " ")[:content_width]
|
||||
title = ("…" + self.title[-(content_width-1):]
|
||||
if len(self.title) > content_width - 2
|
||||
else " " + self.title + " ")
|
||||
try:
|
||||
title_bar = padded_title.center(content_width, self.top)
|
||||
title_bar = title.center(content_width, self.top)
|
||||
except TypeError:
|
||||
padded_title = termstr.TermStr(padded_title)
|
||||
title_bar = padded_title.center(content_width, self.top)
|
||||
title = termstr.TermStr(title)
|
||||
title_bar = title.center(content_width, self.top)
|
||||
result = [self.top_left + title_bar + self.top_right]
|
||||
result.extend(self.left + line + self.right for line in body_content)
|
||||
result.append(self.bottom_left + self.bottom * content_width +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue