show how many bytes are selected
This commit is contained in:
@@ -442,6 +442,9 @@ class InnerBigText(QWidget):
|
||||
def _update_highlight_selected_text(self):
|
||||
start_byte = min(self.selection_highlight.start_byte, self.selection_highlight.end_byte)
|
||||
end_byte = max(self.selection_highlight.start_byte, self.selection_highlight.end_byte)
|
||||
|
||||
self._update_status_bar(start_byte, end_byte)
|
||||
|
||||
if abs(start_byte - end_byte) < 1024:
|
||||
query = self.model.read_range(start_byte, end_byte)
|
||||
if query.find("\n") < 0:
|
||||
@@ -450,6 +453,12 @@ 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))
|
||||
|
||||
def _file_changed(self):
|
||||
if self._follow_tail:
|
||||
self.scroll_to_byte(self.model.byte_count())
|
||||
|
||||
Reference in New Issue
Block a user