remove follow tail
This commit is contained in:
@@ -98,7 +98,6 @@ class BigText(QWidget):
|
|||||||
|
|
||||||
# self.v_scroll_bar.setPageStep(1)
|
# self.v_scroll_bar.setPageStep(1)
|
||||||
self.v_scroll_bar.scaledValueChanged.connect(self.big_text.v_scroll_event)
|
self.v_scroll_bar.scaledValueChanged.connect(self.big_text.v_scroll_event)
|
||||||
self.v_scroll_bar.scrolled_to_end.connect(self.big_text.v_scroll_update_follow_tail)
|
|
||||||
|
|
||||||
if show_range_slider:
|
if show_range_slider:
|
||||||
self.range_limit = RangeSlider()
|
self.range_limit = RangeSlider()
|
||||||
@@ -169,8 +168,6 @@ class InnerBigText(QWidget):
|
|||||||
self._last_double_click_time = 0
|
self._last_double_click_time = 0
|
||||||
self._last_double_click_line_number = -1
|
self._last_double_click_line_number = -1
|
||||||
|
|
||||||
self._follow_tail = False
|
|
||||||
|
|
||||||
self.highlight_selected_text = HighlightRegex(
|
self.highlight_selected_text = HighlightRegex(
|
||||||
"",
|
"",
|
||||||
is_regex=False,
|
is_regex=False,
|
||||||
@@ -405,10 +402,6 @@ class InnerBigText(QWidget):
|
|||||||
self._byte_offset = int(byte_offset)
|
self._byte_offset = int(byte_offset)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@Slot()
|
|
||||||
def v_scroll_update_follow_tail(self, scrolled_to_end: bool):
|
|
||||||
self._follow_tail = scrolled_to_end
|
|
||||||
|
|
||||||
def update_longest_line(self, length: int):
|
def update_longest_line(self, length: int):
|
||||||
width_in_chars = self.width() / self.char_width
|
width_in_chars = self.width() / self.char_width
|
||||||
# print("width_in_chars: %d" % width_in_chars)
|
# print("width_in_chars: %d" % width_in_chars)
|
||||||
@@ -533,13 +526,10 @@ class InnerBigText(QWidget):
|
|||||||
PluginRegistry.execute("update_status_bar", "")
|
PluginRegistry.execute("update_status_bar", "")
|
||||||
|
|
||||||
def _file_changed(self):
|
def _file_changed(self):
|
||||||
if self._follow_tail:
|
|
||||||
self.scroll_to_byte(self.model.byte_count())
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def paintEvent(self, event: QPaintEvent) -> None:
|
def paintEvent(self, event: QPaintEvent) -> None:
|
||||||
start_ns = time.process_time_ns()
|
start_ns = time.process_time_ns()
|
||||||
# print(f"paint {self.model.get_file()} at {self._byte_offset} with follow_tail={self._follow_tail}")
|
|
||||||
painter = QPainter(self)
|
painter = QPainter(self)
|
||||||
# font = "Courier New" if sys.platform == 'win32' or sys.platform == 'cygwin' else "Monospace"
|
# font = "Courier New" if sys.platform == 'win32' or sys.platform == 'cygwin' else "Monospace"
|
||||||
painter.setFont(QFont("Courier New", self.model.settings.getint_session('general', "font_size")))
|
painter.setFont(QFont("Courier New", self.model.settings.getint_session('general', "font_size")))
|
||||||
|
|||||||
Reference in New Issue
Block a user