Skip to content

[listview] fix jumping over very long lines with Page Up#1530

Merged
tstack merged 1 commit into
tstack:masterfrom
Yukigaru:fix-listview-jump-over-long-line
Aug 26, 2025
Merged

[listview] fix jumping over very long lines with Page Up#1530
tstack merged 1 commit into
tstack:masterfrom
Yukigaru:fix-listview-jump-over-long-line

Conversation

@Yukigaru

@Yukigaru Yukigaru commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Hi, this fixes an issue with jumping over very long lines (that don't even fit on screen) (btw this's a common case in our logs) with "Page Up".
In such cases rows_available returns 1 and shift_amount evaluates to 0, meaning you can't progress towards the top. In the fix I ensured that rows_available has enough value to proceed, which is close to what has been done in "Page Down" code.

Note #1: I used this Python script to generate a text file to test on:

with open("test-big.log", "w") as f:
    f.writelines(f"before {i}\n" for i in range(1, 81))
    f.writelines(f"{i} ThisIsALongLine, " for i in range(1, 1500))
    f.write("\n")
    f.writelines(f"after {i}\n" for i in range(1, 81))

@tstack tstack merged commit a7270e8 into tstack:master Aug 26, 2025
1 of 3 checks passed
@tstack

tstack commented Aug 26, 2025

Copy link
Copy Markdown
Owner

Thanks! I appreciate you providing the script to help with reproduction and the change seems to work.

Sorry for the trouble, I don't use word-wrap much, so don't feel the pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants