@@ -196,7 +196,7 @@ public class MultiDiffPanelController implements ActionListener, PropertyChangeL
196196
197197 private GitProgressSupport statusRefreshSupport ;
198198 private PreferenceChangeListener prefList ;
199-
199+
200200 private final Revision revisionOriginalLeft ;
201201 private final Revision revisionOriginalRight ;
202202 private Revision revisionLeft ;
@@ -211,7 +211,7 @@ public class MultiDiffPanelController implements ActionListener, PropertyChangeL
211211 private int popupViewIndex ;
212212 private int requestedRightLine = -1 ;
213213 private int requestedLeftLine = -1 ;
214-
214+
215215 private static final int VIEW_MODE_TABLE = 1 ;
216216 private static final int VIEW_MODE_TREE = 2 ;
217217 private int currentSetupDiffLengthChanged ;
@@ -270,7 +270,7 @@ public MultiDiffPanelController (File file, Revision rev1, Revision rev2, int re
270270 prepareTask = RP .create (dpt );
271271 prepareTask .schedule (0 );
272272 }
273-
273+
274274 private MultiDiffPanelController (VCSContext context , Revision revisionLeft , Revision revisionRight , boolean fixedRevisions ) {
275275 this .context = context ;
276276 this .revisionLeft = revisionOriginalLeft = revisionLeft ;
@@ -315,7 +315,7 @@ private void setActiveComponent (DiffFileViewComponent<DiffNode> fileComponent)
315315 panel .splitPane .setTopComponent (getActiveFileComponent ().getComponent ());
316316 panel .splitPane .setDividerLocation (gg );
317317 }
318-
318+
319319 private void refreshSelectionCombos () {
320320 if (!fixedRevisions && GitUtils .getRepositoryRoots (context ).size () == 1 ) {
321321 panel .cmbDiffTreeFirst .setEnabled (false );
@@ -432,7 +432,7 @@ public void componentClosed () {
432432 cancelBackgroundTasks ();
433433 setups .clear ();
434434 editorCookies .clear ();
435-
435+
436436 if (list != null ) {
437437 Git .getInstance ().getFileStatusCache ().removePropertyChangeListener (list );
438438 }
@@ -569,7 +569,7 @@ private void initToolbarButtons () {
569569 panel .treeButton .setVisible (false );
570570 }
571571 }
572-
572+
573573 private JComponent getInfoPanelLoading () {
574574 if (infoPanelLoadingFromRepo == null ) {
575575 infoPanelLoadingFromRepo = new NoContentPanel (NbBundle .getMessage (MultiDiffPanel .class , "MSG_DiffPanel_NoContent" ));
@@ -812,11 +812,11 @@ public void run () {
812812 public void run () {
813813 multiTextDiffSupport = null ;
814814 }
815-
815+
816816 });
817817 }
818818 }
819-
819+
820820 private String findEncoding () {
821821 for (File f : actionRoots .getValue ()) {
822822 FileObject fo = FileUtil .toFileObject (f );
@@ -861,7 +861,7 @@ private void exportDiff (ByteArrayOutputStream bos) throws GitException {
861861 actionRoots .getKey (), Bundle .MSG_DiffPanel_multiTextualDiff_preparing ());
862862 }
863863 }
864-
864+
865865 });
866866 displayDiffView ();
867867 }
@@ -891,7 +891,7 @@ private Map.Entry<File, File[]> getSelectedActionRoots () {
891891 ctx = GitUtils .getContextForFiles (filterExcluded (selectedFiles ));
892892 return GitUtils .getActionRoots (ctx );
893893 }
894-
894+
895895 private File [] filterExcluded (File [] files ) {
896896 List <File > filtered = new ArrayList <>(files .length );
897897 for (File f : files ) {
@@ -903,7 +903,7 @@ private File[] filterExcluded (File[] files) {
903903 }
904904 return filtered .toArray (new File [0 ]);
905905 }
906-
906+
907907 private boolean showingFileComponent () {
908908 return getActiveFileComponent () != null ;
909909 }
@@ -1064,7 +1064,7 @@ private DiffMode getDiffMode () {
10641064 }
10651065 return diffMode ;
10661066 }
1067-
1067+
10681068 private Revision getSelectedRevision (JComboBox cmbDiffTree ) {
10691069 Object selectedItem = cmbDiffTree .getSelectedItem ();
10701070 Revision selection = null ;
@@ -1123,15 +1123,25 @@ public void propertyChange (PropertyChangeEvent evt) {
11231123 if (FileStatusCache .PROP_FILE_STATUS_CHANGED .equals (evt .getPropertyName ())) {
11241124 FileStatusCache .ChangedEvent changedEvent = (FileStatusCache .ChangedEvent ) evt .getNewValue ();
11251125 if (LOG .isLoggable (Level .FINE )) {
1126- LOG .log (Level .FINE , "File status for file {0} changed from {1} to {2}" , new Object [] {
1127- changedEvent .getFile (),
1126+ LOG .log (Level .FINE , "File status for file {0} changed from {1} to {2}" , new Object [] {
1127+ changedEvent .getFile (),
11281128 changedEvent .getOldInfo (),
11291129 changedEvent .getNewInfo () } );
11301130 }
1131- if (revisionLeft == Revision .HEAD // remove when we're able to refresh single file changes for Local vs. any revision
1131+ if (revisionLeft == Revision .HEAD // remove when we're able to refresh single file changes for Local vs. any revision
11321132 && revisionRight == Revision .LOCAL && affectsView (changedEvent )) {
11331133 applyChange (changedEvent );
11341134 }
1135+ } else if (FileStatusCache .PROP_FILES_STATUS_CHANGED .equals (evt .getPropertyName ())) {
1136+ if (revisionLeft == Revision .HEAD && revisionRight == Revision .LOCAL ) {
1137+ @ SuppressWarnings ("unchecked" )
1138+ List <FileStatusCache .ChangedEvent > changedEvents = (List <FileStatusCache .ChangedEvent >) evt .getNewValue ();
1139+ for (FileStatusCache .ChangedEvent changedEvent : changedEvents ) {
1140+ if (affectsView (changedEvent )) {
1141+ applyChange (changedEvent );
1142+ }
1143+ }
1144+ }
11351145 } else if (DiffController .PROP_DIFFERENCES .equals (evt .getPropertyName ())) {
11361146 // something has changed
11371147 Setup setup = currentSetup ;
@@ -1537,7 +1547,7 @@ private boolean isLocal () {
15371547 * Eliminates unnecessary cache.listFiles call as well as the whole node creation process ()
15381548 */
15391549 private final class ApplyChangesTask implements Runnable , Cancellable {
1540-
1550+
15411551 private volatile boolean canceled ;
15421552
15431553 @ Override
@@ -1651,7 +1661,7 @@ public boolean cancel () {
16511661 return true ;
16521662 }
16531663 }
1654-
1664+
16551665 private class RefreshComboTask implements Runnable {
16561666
16571667 @ Override
@@ -1663,7 +1673,7 @@ public void run () {
16631673 if (revisionOriginalLeft != Revision .HEAD ) {
16641674 modelLeft .add (Revision .HEAD );
16651675 }
1666- modelRight .add (revisionOriginalRight );
1676+ modelRight .add (revisionOriginalRight );
16671677 if (revisionOriginalRight != Revision .LOCAL ) {
16681678 modelRight .add (Revision .LOCAL );
16691679 }
@@ -1767,7 +1777,7 @@ public void run() {
17671777 GitClientExceptionHandler .notifyException (exception , true );
17681778 }
17691779 }
1770-
1780+
17711781 private DiffNode [] prepareSetupsToRefresh () {
17721782 return Mutex .EVENT .readAccess (new Mutex .Action <DiffNode []>() {
17731783 @ Override
@@ -1810,7 +1820,7 @@ private int getMatchingLine (StreamSource ss2, StreamSource ss1, int requestedRi
18101820 }
18111821 }
18121822 }// </editor-fold>
1813-
1823+
18141824 @ NbBundle .Messages ({
18151825 "MSG_Revision_Select_Tooltip=Select a revision from the picker"
18161826 })
0 commit comments