Community
Participate
Working Groups
Created attachment 283004 [details] Wrong painted caret in source editor Move the caret using the arrow up/down keys. Once you reach the viewport bottom and the StyledText need to be scrolled the visible(!) caret stands still, i.e. does not move until pressing another key. Same for the opposite direction. See the attached video to understand the issue. It shows a source editor but the issue also exist in a plain StyledText, e.g. Snippet376. Happens with and without word wrap. The regression comes from bug 168557. https://git.eclipse.org/r/#/c/159376/ It tries to calculate the new caret location without using getPointAtOffset. That works for some types of scrolling but not from scrolling by LINE_UP or LINE_DOWN. Another variant where the caret is not correctly updates is if the last visible line is only partial shown and you do a mouse click in this partial visible line. The content is scrolled to make the line fully visible, the next input happens where you clicked, but the caret is painted in its old position.
New Gerrit change created: https://git.eclipse.org/r/163500
Added a small test case for this regression. The test succeeds (at least on Windows) before bug 168557.
Sounds like quite severe regression. Revert bug 168557 fix?
I wasn't able to reproduce the problem with Eclipse on Mac. But the test case in gerrit fails on Mac too and it passes on reverting bug 168557. Mickael/Conrad, can you please take a look?
(In reply to Andrey Loskutov from comment #3) > Sounds like quite severe regression. Revert bug 168557 fix? Partially reverting one of the change w.r.t. to "setCaretLocation()" from bug 168557 fix, resolves this issue. Sharing a gerrit shortly.
New Gerrit change created: https://git.eclipse.org/r/163570
Hi Lakshmi, For your review+ for RC1
Gerrit change https://git.eclipse.org/r/163570 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6e641395f4220586d372e17c9814a8641736cc33
Gerrit change https://git.eclipse.org/r/163500 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d125f2576857587481e794299871af484812f593
Thanks Andrey for the review and Paul for the JUnit test, resolving this bug now.
Verified with build I20200526-0600