@@ -358,7 +358,8 @@ private void UpdateReferencesNextTarget()
358
358
oldType = oldType . Trim ( '.' ) ;
359
359
MessageBar . Locked = true ;
360
360
string newFilePath = currentTarget . NewFilePath ;
361
- ScintillaControl sci = AssociatedDocumentHelper . LoadDocument ( currentTarget . TmpFilePath ?? newFilePath ) . SciControl ;
361
+ var doc = AssociatedDocumentHelper . LoadDocument ( currentTarget . TmpFilePath ?? newFilePath ) ;
362
+ ScintillaControl sci = doc . SciControl ;
362
363
List < SearchMatch > matches = search . Matches ( sci . Text ) ;
363
364
string packageReplacement = "package" ;
364
365
if ( currentTarget . NewPackage != "" )
@@ -383,7 +384,7 @@ private void UpdateReferencesNextTarget()
383
384
}
384
385
//Do we want to open modified files?
385
386
//if (sci.IsModify) AssociatedDocumentHelper.MarkDocumentToKeep(file);
386
- PluginBase . MainForm . CurrentDocument . Save ( ) ;
387
+ doc . Save ( ) ;
387
388
MessageBar . Locked = false ;
388
389
UserInterfaceManager . ProgressDialog . Show ( ) ;
389
390
UserInterfaceManager . ProgressDialog . SetTitle ( TextHelper . GetString ( "Info.FindingReferences" ) ) ;
@@ -507,6 +508,7 @@ private void FindFinished(FRResults results)
507
508
entry . Key == currentTarget . NewFilePath ) continue ;
508
509
string file = entry . Key ;
509
510
UserInterfaceManager . ProgressDialog . UpdateStatusMessage ( TextHelper . GetString ( "Info.Updating" ) + " \" " + file + "\" " ) ;
511
+ ITabbedDocument doc ;
510
512
ScintillaControl sci ;
511
513
var actualMatches = new List < SearchMatch > ( ) ;
512
514
foreach ( SearchMatch match in entry . Value )
@@ -521,7 +523,8 @@ private void FindFinished(FRResults results)
521
523
}
522
524
if ( actualMatches . Count == 0 ) continue ;
523
525
int currLine = - 1 ;
524
- sci = AssociatedDocumentHelper . LoadDocument ( file ) . SciControl ;
526
+ doc = AssociatedDocumentHelper . LoadDocument ( file ) ;
527
+ sci = doc . SciControl ;
525
528
string directory = Path . GetDirectoryName ( file ) ;
526
529
// Let's check if we need to add the import. Check the considerations at the start of the file
527
530
// directory != currentTarget.OwnerPath -> renamed owner directory, so both files in the same place
@@ -579,7 +582,7 @@ private void FindFinished(FRResults results)
579
582
Results [ file ] . AddRange ( actualMatches ) ;
580
583
//Do we want to open modified files?
581
584
//if (sci.IsModify) AssociatedDocumentHelper.MarkDocumentToKeep(file);
582
- PluginBase . MainForm . CurrentDocument . Save ( ) ;
585
+ doc . Save ( ) ;
583
586
}
584
587
585
588
currentTargetIndex ++ ;
0 commit comments