MCPcopy
hub / github.com/Textualize/toolong / scroll_pointer_to_center

Method scroll_pointer_to_center

src/toolong/log_lines.py:759–768  ·  view source on GitHub ↗
(self, animate: bool = True)

Source from the content-addressed store, hash-verified

757 self.scroll_pointer_to_center()
758
759 def scroll_pointer_to_center(self, animate: bool = True):
760 if self.pointer_line is None:
761 return
762 y_offset = self.pointer_line - self.scrollable_content_region.height // 2
763 scroll_distance = abs(y_offset - self.scroll_offset.y)
764 self.scroll_to(
765 y=y_offset,
766 animate=animate and 100 > scroll_distance > 1,
767 duration=0.2,
768 )
769
770 def watch_show_find(self, show_find: bool) -> None:
771 self.clear_caches()

Callers 5

advance_searchMethod · 0.95
action_page_downMethod · 0.95
action_page_upMethod · 0.95
action_navigateMethod · 0.95
on_input_changedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected