anchor.diff:    begin
       //to fix CudaText issue #3950.
       //we save selections before running HighlightAll, later we restore them.
  -    SavedCarets:= TATCarets.Create;
  +    bSaveCarets:= AFinder.Editor.Carets.IsSelection;
  +    if bSaveCarets then
  +      SavedCarets:= TATCarets.Create;
  +
       try
  -      bSavedCarets:= AFinder.Editor.Carets.IsSelection;
  -      if bSavedCarets then
  +      if bSaveCarets then
           SavedCarets.Assign(AFinder.Editor.Carets);
   
         //we found and highlighted all matches,
  
positive.code:   StyleBorder: TATLineStyle;
    SavedCarets: TATCarets;
    bChanged: boolean;
    bSavedCarets: boolean;
    NLineCount: integer;
  begin
    ColorBorder:= GetAppStyle(AppHiAll_ThemeStyleId).BgColor;
  
negative.code:           true{ADoUnfold}
            );
  
        if bSaveCarets then
          AFinder.Editor.Carets.Assign(SavedCarets);
      finally
        if bSaveCarets then
          FreeAndNil(SavedCarets);
      end;
    end;
  end;
  