From 3c47db1d9849a141702e8736a4ab0de363c0c339 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sun, 29 Jan 2023 09:35:40 +0100 Subject: [PATCH] clear status bar when removing selection --- src/ui/bigtext/bigtext.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/bigtext/bigtext.py b/src/ui/bigtext/bigtext.py index e9b7b80..fcb4e8a 100644 --- a/src/ui/bigtext/bigtext.py +++ b/src/ui/bigtext/bigtext.py @@ -454,10 +454,13 @@ class InnerBigText(QWidget): self.highlight_selected_text.set_query("") def _update_status_bar(self, start_byte: int, end_byte: int): - bytes_human_readable = humanbytes(end_byte - start_byte) - PluginRegistry.execute("update_status_bar", - _("selected {0} - {1:,.0f}:{2:,.0f}").format(bytes_human_readable, start_byte, - end_byte - 1)) + if end_byte - start_byte > 0: + bytes_human_readable = humanbytes(end_byte - start_byte) + PluginRegistry.execute("update_status_bar", + _("selected {0} - {1:,.0f}:{2:,.0f}").format(bytes_human_readable, start_byte, + end_byte - 1)) + else: + PluginRegistry.execute("update_status_bar", _("")) def _file_changed(self): if self._follow_tail: