Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong file list offset squeeze when scrolloff = 0 #1866

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

aidancz
Copy link
Contributor

@aidancz aidancz commented Oct 31, 2024

this pr fix:

wrong file list offset squeeze (#1865)

@@ -149,7 +149,7 @@ impl Folder {
self.offset = if self.cursor < (self.offset + limit).min(len).saturating_sub(scrolloff) {
len.saturating_sub(limit).min(self.offset)
} else {
len.saturating_sub(limit).min(self.cursor.saturating_sub(limit) + scrolloff)
len.saturating_sub(limit).min(self.cursor.saturating_sub(limit - 1) + scrolloff)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limit could be 0, when the terminal window is too small, which causes the app to crash, please fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, it should be fine now

Copy link
Owner

@sxyazi sxyazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you so much!

@sxyazi sxyazi changed the title fix #1865 fix: wrong file list offset squeeze when scrolloff = 0 Oct 31, 2024
@sxyazi sxyazi merged commit e3c9111 into sxyazi:main Oct 31, 2024
6 checks passed
@aidancz aidancz deleted the aidancz branch October 31, 2024 06:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants