diff options
author | toonn <toonn@toonn.io> | 2022-05-26 17:15:51 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2022-05-26 17:15:51 +0200 |
commit | 4d15badcccf029b9c400df56d4aaf865f7409456 (patch) | |
tree | 0e510fc14a1a522f2f5f9b3fd721964aeb592f0b | |
parent | aaf032252e428a1f0d2f3c6f742811f7f4b880c2 (diff) | |
download | ranger-4d15badcccf029b9c400df56d4aaf865f7409456.tar.gz |
browsercolumn: Fix off-by-one in line number width
The status bar wasn't taken into account when calculating the width of the visible line numbers. This meant the width would change right before a number with an extra digit appeared or one later than when it disappeared.
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 3d68f017..57165424 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -275,7 +275,7 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes # Set the size of the linum text field to the number of digits in the # visible files in directory. - linum_text_len = len(str(self.scroll_begin + self.hei)) + linum_text_len = len(str(self.scroll_begin + self.hei - 1)) linum_format = "{0:>" + str(linum_text_len) + "}" selected_i = self._get_index_of_selected_file() |