-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Desktop: Fix Goto scrolling (#2122) #2199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works. I've tested it on macOS. I'm just wondering why the removed code was there in the first place.
@laurent22 do you remember why that code was there?
I can only say that removing those 2 lines fixes the problem.
The original code makes sense to me: if the note is already visible, there's no need to scroll. So I don't think we can remove this part but rather we should find out why a valid index if outside of bounds. @rccavalcanti, do you know what could be the issue? |
I dove a bit more on that line and found it just has a problem in the boundaries:
So I brought the line back and fixed it. Edit: Clarification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it on macOS. Your fix works! 👍
Great! Just don't merge yet. I'm working in a better fix. |
So previously, I found that However, I thought this was probably unintended and all values should be 0-based. So I went to investigate further. It turns out that I found 2 different bugs in the class that caused the 1-based index:
So I fixed both and kept the line of conditional return unchanged. I think this is much cleaner and probably the final solution. Sorry for the multiple iterations! |
@laurent22 is anything still missing? |
Perfect thanks @rccavalcanti and @tessus! |
Fix issue #2122