Skip to content

Commit b19625e

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: drop new_offset alias in _FullscreenPeek.scroll_down
The local was assigned immediately to `self._offset`, then the follow-mode check re-read it as `new_offset == 0`. Reading `self._offset` directly after assignment has identical semantics — the alias added no value. Sibling `scroll_up` keeps its local because it compares the new value against the old one *before* the assignment (to conditionally disable auto-scroll), which requires two distinct values. `scroll_down` has no such comparison, so the alias is dead. Same shape as ef176bf (`line_count`) and 134078d (`name_col`). Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 9e88c6a commit b19625e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/ralphify/_console_emitter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,8 @@ def scroll_up(self, lines: int = 1) -> None:
763763

764764
def scroll_down(self, lines: int = 1) -> None:
765765
"""Scroll toward newer lines (offset shrinks)."""
766-
new_offset = max(0, self._offset - lines)
767-
self._offset = new_offset
768-
if new_offset == 0:
766+
self._offset = max(0, self._offset - lines)
767+
if self._offset == 0:
769768
self._auto_scroll = True
770769

771770
def scroll_to_top(self) -> None:

0 commit comments

Comments
 (0)