matthiasblaesing commented on code in PR #9240:
URL: https://github.com/apache/netbeans/pull/9240#discussion_r2938827912
##########
ide/markdown/src/org/netbeans/modules/markdown/MarkdownViewerElement.java:
##########
@@ -134,15 +144,21 @@ public void changedUpdate(DocumentEvent e) {
};
private final Task updater =
RP.create(MarkdownViewerElement.this::updateView);
+
private StyledDocument source;
+ //Font config update listener
+ private volatile boolean fontChanged = false;
Review Comment:
I meant that `fontChanged` can be moved into `colorProfileChange`. If it is
ever set to `true`, that it is done in that method and it will be reset there
also directly.
```diff
+++
b/ide/markdown/src/org/netbeans/modules/markdown/MarkdownViewerElement.java
@@ -150,7 +150,6 @@
private StyledDocument source;
//Font config update listener
- private volatile boolean fontChanged = false;
private final PropertyChangeListener pcl = this::colorProfileChange;
public MarkdownViewerElement(Lookup lookup) {
@@ -319,9 +318,10 @@
String newValue =(evt.getNewValue() instanceof String ) ? (String)
evt.getNewValue() : ""; // NOI18N
+ boolean fontChanged = false;
+
//patch for triggering font update
- if (!fontChanged &&
- "fontColors".equals(evt.getPropertyName()) // NOI18N
+ if ("fontColors".equals(evt.getPropertyName()) // NOI18N
&& evt.getOldValue() != null
&& !newValue.startsWith("test") // NOI18N
) {
@@ -329,7 +329,6 @@
}
if (fontChanged ||
EditorSettings.PROP_CURRENT_FONT_COLOR_PROFILE.equals(evt.getPropertyName())) {
- fontChanged = false;
viewer.setEditorKit(new MarkdownEditorKit());
updateView();
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists