You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "junichi11 (via GitHub)" <gi...@apache.org> on 2023/04/01 15:28:44 UTC

[GitHub] [netbeans] junichi11 commented on a diff in pull request #5759: Avoid being scrolled to the end of the editor in the preview panel for formatting options

junichi11 commented on code in PR #5759:
URL: https://github.com/apache/netbeans/pull/5759#discussion_r1155125666


##########
php/php.editor/src/org/netbeans/modules/php/editor/indent/FmtOptions.java:
##########
@@ -569,8 +574,9 @@ public void run() {
             } else {
                 LOGGER.warning(String.format("Can't format %s; it's not BaseDocument.", doc)); //NOI18N
             }
+            pane.setCaretPosition(caretPosition);
             pane.setIgnoreRepaint(false);
-            pane.scrollRectToVisible(visibleRectangle);
+            SwingUtilities.invokeLater(() -> pane.scrollRectToVisible(visibleRectangle));

Review Comment:
   Because the preview pane is scrolled to the caret position when we change options after we scroll it anywhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists