Community
Participate
Working Groups
Build ID: I20070313-1051 In the default detail pane, the find/replace action does not scroll to reveal the selection when the find button is pressed. Scrolling down manually will show that the correct element is selected.
The internalRevealChange method in TextViewer is responsible for scrolling to the correct position. This method is called with the proper offset. However, when determining what line to scroll to, the result is always 0. There are no line breaks in the text (so it is all one line), but text wrapping is turned on.
*** Bug 179842 has been marked as a duplicate of this bug. ***
Curtis will investigate as M7 polish item. Not sure if we can do this with existing API when using SWT.WRAP in the text widget.
Moving to Platform Text for comment Looking at TextViewer the findAndSelect and findAndSelectInRange methods call setSelectionRange on the text widget and then call internalRevealRange to display the now selected text. internalRevealRange does not work with wrapping on because all of the text is on one line. By replacing the call to internalRevealRange with a call to showSelection on the text widget, the proper text is selected and the widget scrolls to the correct location. Is it possible to change the TextViewer code to display the selection this way or will doing so break other functionality?
Please see the TextViewer constructor's Javadoc. If you decide to use SWT.WRAP you have to provide your own implementation of IDocumentAdapter that takes care of such issues. We can't change the reveal code.
Fixed in HEAD See DefaultDetailPane Created a wrapper class for the find replace target that calls showSelection on the styled text after the findAndSelect method completes.
Mike, please verify.
verified