Smaller bug fixes in the editor libraries#8324
Merged
eirikbakke merged 4 commits intoapache:masterfrom Mar 15, 2025
Merged
Conversation
…e the repaint area on 2x HiDPI scaling.
The bug was easy to reproduce in the IDE: 1) Create an empty text file 2) Enter one line of text 3) Move the cursor to the start 4) Press Enter a few times. Frequently, when the necessary repaint isn't coincidentally triggered by the cursor blinking, the line will appear painted multiple times (because the previous position of the shifted line isn't repainted).
…ing off the paintable edge at the end of a long line.
matthiasblaesing
approved these changes
Mar 14, 2025
Contributor
matthiasblaesing
left a comment
There was a problem hiding this comment.
Did a quick test on a "normal" screen. Caret still seems to work correctly, I reproduced the redrawing problem and found it fixed with this change. Eyeballed the rest and looks sane to me.
Contributor
Author
|
Thanks for testing and reviewing! |
Contributor
Author
Contributor
|
Just looked into another project and there all options (plain merge, squash and merge and rebase and merge) are available and for merge it looks identical. The GUI makes sense when you come from git CLI client as for a non-ff merge a commit message is required there too. As the email is selectable, I assume that it will be correctly recorded. |
Contributor
Author
|
Thanks! Yeah, I merged and it looks the same as other merged PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Here are a few smaller bug fixes in the ide/editor.lib2 module, each in a separate commit (since they are independent of each other).
For platform apps that use the THIN_LINE_CARET option, on HiDPI monitors, fix a paint bug where a pixel-thick line from the caret may remain outside the repaint area, leaving "cursor droppings" behind as the user types.
Avoid a NullPointerException that could occur if an editor is closed while MacOS trackpad scrolling events are still coming in.
Fix an editor repaint bug which could leave lines appearing duplicated. Easy to reproduce on plain text files; see the commit for reproduction steps.
The cause was clear: An existing comment in o.n.modules.editor.lib2.view.ViewBuilder explains that "For valid firstReplace the current impl repaints whole line", but that repaint was in a block of code that was being skipped as an optimization (the "accurate span" calculation). The fix is to check for the "firstReplace" case and ensure that repaint() will be called regardless (via the checkLayoutUpdate method).
When line wrapping is enabled, adjust the wrap line length so that the text caret can't end up completely outside the scroll viewport (making it invisible).