geertjanw closed pull request #514: [NETBEANS-713] Have HighlightingManager 
properly respond to changes in excludes/includes client property.
URL: https://github.com/apache/incubator-netbeans/pull/514
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
index 32ab8ed53..f72f053c8 100644
--- 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
+++ 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
@@ -197,11 +197,15 @@ private HighlightingManager(JTextComponent pane) {
         public Highlighting(HighlightingManager manager, JTextComponent pane) {
             this.manager = manager;
             this.pane = pane;
-            this.paneFilter = new 
RegExpFilter(pane.getClientProperty(PROP_HL_INCLUDES), 
pane.getClientProperty(PROP_HL_EXCLUDES));
+            updatePaneFilter();
             
this.pane.addPropertyChangeListener(WeakListeners.propertyChange(this, pane));
             rebuildAll();
         }
         
+        private synchronized void updatePaneFilter() {
+            paneFilter = new 
RegExpFilter(pane.getClientProperty(PROP_HL_INCLUDES), 
pane.getClientProperty(PROP_HL_EXCLUDES));
+        }
+
         synchronized HighlightsContainer bottomHighlights() {
             return bottomHighlights;
         }
@@ -241,6 +245,7 @@ synchronized HighlightsLayer findLayer(HighlightsContainer 
container) {
 
         public @Override void propertyChange(PropertyChangeEvent evt) {
             if (evt.getPropertyName() == null || 
PROP_DOCUMENT.equals(evt.getPropertyName())) {
+                updatePaneFilter();
                 Document doc = pane.getDocument();
                 if (doc != null) {
                     doc.render(new Runnable() {
@@ -253,6 +258,7 @@ public void run() {
             }
 
             if (PROP_HL_INCLUDES.equals(evt.getPropertyName()) || 
PROP_HL_EXCLUDES.equals(evt.getPropertyName())) {
+                updatePaneFilter();
                 rebuildAllLayers();
             }
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

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

Reply via email to