Community
Participate
Working Groups
When the viewport is scrolled by mouse wheel or the scroll bars, the caret moves with the viewport. The caret should not move when the viewport is scrolled.
Created attachment 25565 [details] patch for scrolling problem in the text example The caret should be redrawn when the viewport is scrolled. The patch listens to the scrolling and redraws the caret.
Takahiro-san, are all these changes in your patch really necessary? Can't you just invoke refreshCaret() (or queueCaretRefresh()) when the range model changes? Also, you don't need the configureViewer() method. You can add the listeners to the viewport's range models in hookControl() (and remove them in unhookControl()). One other option to fix this bug might be to invoke queueCaretRefresh() when update manager paints, rather than when it validates (see the update listener added in hookControl()). But that's probably too agressive, so it's better to stick with your approach of adding listeners for scroll changes. A couple of things to keep in mind about submitting patches. You should mention whether it is to be applied to a class, package or a project. And you should also add yourself to the copyright section (under contributors) of any classes that you modify. Something like: Takahiro Kato - Added code to update caret during scrolling (Bug 105813)
It does contain unnecessary code. Sorry about that, I realized that after I submitted. It contains a fix to some other bugs related to moving the caret around with the arrow keys. I'll post the better patch as soon as possible. BTW, configureViewer() is needed because registering listeners must occur after GraphicalTextViewer.createControl(Composite) because the ScrollingGraphicalViewer.installRootFigure() somehow creates a new set of range models. I tried registering listeners in hookControl(), but because this method is called before installRootFigure(), liteners listen to the range models that are stale.
Created attachment 25687 [details] patch that only contains the fix for this bug the same as the previous one except that it only contains the necessary code to fix this bug. again, we haven't figured out what to put in the copyright section, so I left it as it is.
Fixed. The caret is refreshed when painting occurs.
This should probably be just when validation occurs. If we change where the caret is managed, this should be revisited.
Comment on attachment 25565 [details] patch for scrolling problem in the text example As this patch does not seem to have been applied, marking it as obsolete.
Comment on attachment 25687 [details] patch that only contains the fix for this bug This patch does not seem to have been applied, thus marking as obsolete.