Community
Participate
Working Groups
This changes from bug #562676 introduced a regression: the caret column does not persist when it is moved from the end of a long line to a short one and back again. ** Steps to reproduce ** Open a text editor (I reproduced it in the java editor). Enter the following text: a very very very long line a short line Position the caret at the end of line 1, press "cursor down", then "cursor up" on your keyboard. ** Observed behavior ** The caret is now in the middle of line 1. ** Expected behavior ** The caret should be at the end of line 1. This was the behavior before this change, which was accomplished by storing the previous caret position in "StyledText.columnX". However, with this change, columnX is no longer read in https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20Custom%20Widgets/common/org/eclipse/swt/custom/StyledText.java?id=4e0d3cef45c6b6512666f9d51e8154ed545bc57b#n2701 nor in https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20Custom%20Widgets/common/org/eclipse/swt/custom/StyledText.java?id=4e0d3cef45c6b6512666f9d51e8154ed545bc57b#n2805 (See also Bug #5935 and #108792)
I can't reproduce on Linux / master. Which exact Eclipse version are you using?
I am really sorry, I was really sure I tried it with the newest version, but turns out a new version was released... The bug occurred with: Version: 2021-09 (4.21.0) Build id: 20210910-1417 I just downloaded the newest version and can't reproduce. Version: 2021-12 (4.22.0) Build id: 20211202-1639 The only remaining question might be whether a check for this behavior could be added to a unit test so it won't break again. Anyway, sorry for the spam!
Tests have been added as well, see Bug 576052 *** This bug has been marked as a duplicate of bug 576052 ***