diff --git a/components/ideintf/inputhistory.pas b/components/ideintf/inputhistory.pas index b222d78fd6..80208acba3 100644 --- a/components/ideintf/inputhistory.pas +++ b/components/ideintf/inputhistory.pas @@ -44,7 +44,7 @@ uses LazFileCache, LazFileUtils, LazLoggerBase, LazUTF8, AvgLvlTree, Laz2_XMLCfg, LazConfigStorage, // IdeConfig - LazConf, RecentListProcs, IdeXmlConfigProcs, + RecentListProcs, IdeXmlConfigProcs, // IdeIntf ProjectIntf, IDEDialogs; @@ -162,8 +162,7 @@ type FCleanOutputFileMask: string; FCleanSourcesFileMask: string; FFileDialogSettings: TFileDialogSettings; - FFilename: string; - + // Find- and replace-history FFindHistory: TStringList; FFindInFilesSearchOptions: TLazFindInFileSearchOptions; @@ -187,6 +186,7 @@ type procedure SetFilename(const AValue: string); protected + FFilename: string; procedure LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract; procedure SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract; public @@ -296,7 +296,6 @@ implementation const - DefaultHistoryFile = 'inputhistory.xml'; InputHistoryVersion = 1; function CompareIHIgnoreItems(Item1, Item2: Pointer): integer; @@ -508,12 +507,7 @@ begin end; procedure TInputHistories.SetLazarusDefaultFilename; -var - ConfFileName: string; begin - ConfFileName:=AppendPathDelim(GetPrimaryConfigPath)+DefaultHistoryFile; - CopySecondaryConfigFile(DefaultHistoryFile); - FFilename:=ConfFilename; end; procedure TInputHistories.Load; diff --git a/ide/diffdialog.pas b/ide/diffdialog.pas index b156805a12..dd898adfae 100644 --- a/ide/diffdialog.pas +++ b/ide/diffdialog.pas @@ -47,9 +47,10 @@ uses // SynEdit SynEdit, SynHighlighterDiff, // IdeIntf - IDEWindowIntf, IDEHelpIntf, IDEImagesIntf, InputHistory, + IDEWindowIntf, IDEHelpIntf, IDEImagesIntf, // IDE - LazarusIDEStrConsts, EditorOptions, DiffPatch, SourceEditor, EnvironmentOpts; + LazarusIDEStrConsts, EditorOptions, DiffPatch, SourceEditor, + InputhistoryWithSearchOpt, EnvironmentOpts; type @@ -440,7 +441,7 @@ begin // get recent Text 2 i:=0; - LastText2Name:=InputHistories.DiffText2; + LastText2Name:=InputHistoriesSO.DiffText2; if LastText2Name<>'' then i:=fAvailableFiles.IndexOfName(LastText2Name); if i<0 then i:=0; @@ -448,7 +449,7 @@ begin fSelectedFile2.SetIndex(i); // set recent options - SetDiffOptions(InputHistories.DiffFlags); + SetDiffOptions(InputHistoriesSO.DiffFlags); // and action ... UpdateDiff; @@ -481,13 +482,13 @@ end; procedure TDiffDlg.SaveSettings; begin - InputHistories.DiffFlags:=GetDiffOptions; + InputHistoriesSO.DiffFlags:=GetDiffOptions; if (fSelectedFile2<>nil) and (fSelectedFile2.fFile<>nil) then begin - InputHistories.DiffText2:=fSelectedFile2.fFile.Name; - InputHistories.DiffText2OnlySelection:=Text2OnlySelectionCheckBox.Checked; + InputHistoriesSO.DiffText2:=fSelectedFile2.fFile.Name; + InputHistoriesSO.DiffText2OnlySelection:=Text2OnlySelectionCheckBox.Checked; end else begin - InputHistories.DiffText2:=''; - InputHistories.DiffText2OnlySelection:=false; + InputHistoriesSO.DiffText2:=''; + InputHistoriesSO.DiffText2OnlySelection:=false; end; IDEDialogLayoutList.SaveLayout(Self); end; diff --git a/ide/inputhistorywithsearchopt.pas b/ide/inputhistorywithsearchopt.pas index f96ef06043..e5306ad6db 100644 --- a/ide/inputhistorywithsearchopt.pas +++ b/ide/inputhistorywithsearchopt.pas @@ -30,11 +30,11 @@ interface uses // LazUtils - Laz2_XMLCfg, + Laz2_XMLCfg, LazFileUtils, // SynEdit SynEditTypes, // IDE - InputHistory, DiffPatch; + LazConf, InputHistory, DiffPatch; type @@ -65,6 +65,8 @@ type constructor Create; destructor Destroy; override; procedure Clear; override; + procedure SetLazarusDefaultFilename; override; + property FindOptions[const ASelAvail: Boolean]: TSynSearchOptions read GetFindOptions write SetFindOptions; procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); override; procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); override; @@ -99,6 +101,7 @@ var implementation const + DefaultHistoryFile = 'inputhistory.xml'; DefaultDiffFlags = [tdfIgnoreCase,tdfIgnoreEmptyLineChanges, tdfIgnoreLineEnds,tdfIgnoreTrailingSpaces]; @@ -123,6 +126,16 @@ begin FDiffText2OnlySelection:=false; end; +procedure TInputHistoriesWithSearchOpt.SetLazarusDefaultFilename; +var + ConfFileName: string; +begin + ConfFileName:=AppendPathDelim(GetPrimaryConfigPath)+DefaultHistoryFile; + CopySecondaryConfigFile(DefaultHistoryFile); + FFilename:=ConfFilename; + inherited SetLazarusDefaultFilename; +end; + procedure TInputHistoriesWithSearchOpt.LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); var