@@ -972,22 +972,28 @@ private void OnSingleFileChanged(object sender, FileSystemEventArgs e)
972972 // Update the file status in the status bar
973973 UpdateFileStatus ( ) ;
974974
975- // Process all enabled tabs in parallel for better performance
976- ProcessAllEnabledTabsParallel ( ) ;
977-
978- // Mark files as changed for disabled tabs
979- foreach ( var tab in tabs . Where ( t => ! t . IsWatchingEnabled ) )
980- {
981- if ( tab . TabItem . IsSelected == false )
982- {
983- // Set the file changed flag for disabled non active tabs
984- tab . FileChangedFlag = true ;
985- }
986- }
975+ // Process changes in the file
976+ ProcessChanges ( ) ;
987977 } ) ;
988978 }
989979 }
990980
981+ private void ProcessChanges ( )
982+ {
983+ // Process all enabled tabs in parallel for better performance
984+ ProcessAllEnabledTabsParallel ( ) ;
985+
986+ // Mark files as changed for disabled tabs
987+ foreach ( var tab in tabs . Where ( t => ! t . IsWatchingEnabled ) )
988+ {
989+ if ( tab . TabItem . IsSelected == false )
990+ {
991+ // Set the file changed flag for disabled non active tabs
992+ tab . FileChangedFlag = true ;
993+ }
994+ }
995+ }
996+
991997 /// <summary>
992998 /// Processes file updates in parallel for all enabled tabs by reading each source line once
993999 /// and applying it to all tabs that match the line.
@@ -1495,20 +1501,8 @@ private void OnForcedRefreshTimerTick(object? sender, EventArgs e)
14951501 // Simulate the file change event
14961502 Dispatcher . Invoke ( ( ) =>
14971503 {
1498- // Process each tab based on its watching state
1499- foreach ( var tab in tabs )
1500- {
1501- if ( tab . IsWatchingEnabled )
1502- {
1503- // If watching is enabled, process the content now
1504- ProcessTabContent ( tab ) ;
1505- }
1506- else
1507- {
1508- // If watching is disabled, just mark the file changed flag
1509- tab . FileChangedFlag = true ;
1510- }
1511- }
1504+ // Process changes as if the file was modified
1505+ ProcessChanges ( ) ;
15121506 } ) ;
15131507 }
15141508 }
0 commit comments