mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 14:32:38 +02:00
IDE: Split InputHistories unit into 2 pieces to break SynEdit dependency.
git-svn-id: trunk@53729 -
This commit is contained in:
parent
9c61946e73
commit
aa9f568d95
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6293,6 +6293,7 @@ ide/initialsetupdlgs.pas svneol=native#text/pascal
|
||||
ide/initialsetupproc.pas svneol=native#text/plain
|
||||
ide/inputfiledialog.pas svneol=native#text/pascal
|
||||
ide/inputhistory.pas svneol=native#text/pascal
|
||||
ide/inputhistorywithsearchopt.pas svneol=native#text/pascal
|
||||
ide/inspectchksumchangeddlg.lfm svneol=native#text/plain
|
||||
ide/inspectchksumchangeddlg.pas svneol=native#text/pascal
|
||||
ide/invertassigntool.pas svneol=native#text/pascal
|
||||
|
@ -178,7 +178,7 @@ type
|
||||
procedure TranslateMacros;
|
||||
procedure SetupExternalTools;
|
||||
procedure SetupCompilerInterface;
|
||||
procedure SetupInputHistories;
|
||||
procedure SetupInputHistories(aInputHist: TInputHistories);
|
||||
procedure EnvOptsChanged;
|
||||
|
||||
function GetBuildMacroOverride(const MacroName: string): string; override;
|
||||
@ -264,8 +264,7 @@ begin
|
||||
Pointer(UnitFile2^.FileUnitName));
|
||||
end;
|
||||
|
||||
function CompareUnitNameAndUnitFile(UnitName: PChar;
|
||||
UnitFile: PUnitFile): integer;
|
||||
function CompareUnitNameAndUnitFile(UnitName: PChar; UnitFile: PUnitFile): integer;
|
||||
begin
|
||||
Result:=CompareIdentifierPtrs(Pointer(UnitName),Pointer(UnitFile^.FileUnitName));
|
||||
end;
|
||||
@ -524,14 +523,10 @@ begin
|
||||
TheCompiler := TCompiler.Create;
|
||||
end;
|
||||
|
||||
procedure TBuildManager.SetupInputHistories;
|
||||
procedure TBuildManager.SetupInputHistories(aInputHist: TInputHistories);
|
||||
begin
|
||||
if InputHistories<>nil then exit;
|
||||
InputHistories:=TInputHistories.Create;
|
||||
with InputHistories do begin
|
||||
SetLazarusDefaultFilename;
|
||||
Load;
|
||||
end;
|
||||
aInputHist.SetLazarusDefaultFilename;
|
||||
aInputHist.Load;
|
||||
end;
|
||||
|
||||
procedure TBuildManager.EnvOptsChanged;
|
||||
|
@ -18,12 +18,19 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
FileProcs, LazFileUtils,
|
||||
// LCL
|
||||
LCLProc, Controls, StdCtrls, Forms, Buttons, ExtCtrls, Dialogs, ButtonPanel,
|
||||
// Codetools
|
||||
FileProcs,
|
||||
// LazUtils
|
||||
LazFileUtils,
|
||||
// SynEdit
|
||||
SynEditTypes, SynEdit,
|
||||
// IdeIntf
|
||||
MacroIntf, IDEWindowIntf, SrcEditorIntf, IDEHelpIntf, IDEDialogs,
|
||||
LazarusIDEStrConsts, InputHistory, EditorOptions, Project, IDEProcs,
|
||||
SearchFrm, SearchResultView;
|
||||
// IDE
|
||||
LazarusIDEStrConsts, InputHistory, InputhistoryWithSearchOpt, EditorOptions, Project,
|
||||
IDEProcs, SearchFrm, SearchResultView;
|
||||
|
||||
type
|
||||
{ TLazFindInFilesDialog }
|
||||
@ -367,7 +374,8 @@ begin
|
||||
// show last used file masks
|
||||
AssignToComboBox(FileMaskComboBox, InputHistories.FindInFilesMaskHistory);
|
||||
Options := InputHistories.FindInFilesSearchOptions;
|
||||
SynSearchOptions := InputHistories.FindOptions * SharedOptions;//share basic options with FindReplaceDlg
|
||||
//share basic options with FindReplaceDlg
|
||||
SynSearchOptions := InputHistoriesSO.FindOptions * SharedOptions;
|
||||
end;
|
||||
|
||||
procedure TLazFindInFilesDialog.SaveHistory;
|
||||
@ -382,7 +390,9 @@ begin
|
||||
InputHistories.AddToFindInFilesPathHistory(Dir);
|
||||
InputHistories.AddToFindInFilesMaskHistory(FileMaskComboBox.Text);
|
||||
InputHistories.FindInFilesSearchOptions:=Options;
|
||||
InputHistories.FindOptions := InputHistories.FindOptions - SharedOptions + (SynSearchOptions*SharedOptions);//share basic options with FindReplaceDlg
|
||||
//share basic options with FindReplaceDlg
|
||||
InputHistoriesSO.FindOptions := InputHistoriesSO.FindOptions - SharedOptions
|
||||
+ (SynSearchOptions*SharedOptions);
|
||||
InputHistories.Save;
|
||||
end;
|
||||
|
||||
|
@ -46,8 +46,6 @@ uses
|
||||
FileProcs,
|
||||
// IdeIntf
|
||||
ProjectIntf, IDEDialogs,
|
||||
// SynEdit
|
||||
SynEditTypes,
|
||||
// IDE
|
||||
DiffPatch, LazConf, IDEProcs;
|
||||
|
||||
@ -178,7 +176,6 @@ type
|
||||
FFindHistory: TStringList;
|
||||
FFindInFilesSearchOptions: TLazFindInFileSearchOptions;
|
||||
FFindAutoComplete: boolean;
|
||||
FFindOptions: TSynSearchOptions;
|
||||
FIgnores: TIHIgnoreIDEQuestionList;
|
||||
FLastConvertDelphiPackage: string;
|
||||
FLastConvertDelphiProject: string;
|
||||
@ -193,11 +190,13 @@ type
|
||||
|
||||
// various history lists
|
||||
FHistoryLists: THistoryLists;
|
||||
|
||||
// file encodings
|
||||
fFileEncodings: TStringToStringTree;
|
||||
|
||||
procedure SetFilename(const AValue: string);
|
||||
protected
|
||||
procedure LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
||||
procedure SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
@ -233,7 +232,6 @@ type
|
||||
write FFindInFilesPathHistory;
|
||||
property FindInFilesMaskHistory: TStringList read FFindInFilesMaskHistory
|
||||
write FFindInFilesMaskHistory;
|
||||
property FindOptions: TSynSearchOptions read FFindOptions write FFindOptions;
|
||||
property FindInFilesSearchOptions: TLazFindInFileSearchOptions
|
||||
read FFindInFilesSearchOptions write FFindInFilesSearchOptions;
|
||||
property FindAutoComplete: boolean read FFindAutoComplete
|
||||
@ -253,7 +251,6 @@ type
|
||||
property DiffText2: string read FDiffText2 write FDiffText2;
|
||||
property DiffText2OnlySelection: boolean read FDiffText2OnlySelection
|
||||
write FDiffText2OnlySelection;
|
||||
|
||||
// new dialog
|
||||
property NewProjectType: string read FNewProjectType write FNewProjectType;
|
||||
property NewFileType: string read FNewFileType write FNewFileType;
|
||||
@ -279,20 +276,6 @@ type
|
||||
|
||||
const
|
||||
LazFindSearchOptionsDefault = [];
|
||||
LazFindSearchOptionNames: array[TSynSearchOption] of string = (
|
||||
'MatchCase',
|
||||
'WholeWord',
|
||||
'Backwards',
|
||||
'EntireScope',
|
||||
'SelectedOnly',
|
||||
'Replace',
|
||||
'ReplaceAll',
|
||||
'Prompt',
|
||||
'SearchInReplacement',
|
||||
'RegExpr',
|
||||
'RegExprMultiLine',
|
||||
'ssoFindContinue'
|
||||
);
|
||||
LazFindInFileSearchOptionsDefault = [fifSearchOpen, fifIncludeSubDirs];
|
||||
LazFindInFileSearchOptionNames: array[TLazFindInFileSearchOption] of string =(
|
||||
'MatchCase',
|
||||
@ -373,7 +356,6 @@ begin
|
||||
FFindInFilesPathHistory:=TStringList.Create;
|
||||
FFindInFilesMaskHistory:=TStringList.Create;
|
||||
FFindInFilesSearchOptions:=LazFindInFileSearchOptionsDefault;
|
||||
FFindOptions:=LazFindSearchOptionsDefault;
|
||||
|
||||
// file dialog
|
||||
FFileDialogSettings.HistoryList:=TStringList.Create;
|
||||
@ -381,9 +363,7 @@ begin
|
||||
|
||||
// various history lists
|
||||
FHistoryLists:=THistoryLists.Create;
|
||||
|
||||
fFileEncodings:=TStringToStringTree.Create({$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF});
|
||||
|
||||
FIgnores:=TIHIgnoreIDEQuestionList.Create;
|
||||
IgnoreQuestions:=FIgnores;
|
||||
|
||||
@ -434,7 +414,6 @@ procedure TInputHistories.LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: s
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
FIFOption: TLazFindInFileSearchOption;
|
||||
FindOption: TSynSearchOption;
|
||||
begin
|
||||
// Find- and replace-history
|
||||
FMaxFindHistory:=XMLConfig.GetValue(Path+'Find/History/Max',FMaxFindHistory);
|
||||
@ -454,16 +433,7 @@ begin
|
||||
then
|
||||
Include(FFindInFilesSearchOptions,FIFOption);
|
||||
end;
|
||||
|
||||
FFindOptions:=[];
|
||||
for FindOption:=Low(FFindOptions) to High(FFindOptions)
|
||||
do begin
|
||||
if XMLConfig.GetValue(
|
||||
Path+'Find/Options/'+LazFindSearchOptionNames[FindOption],
|
||||
FindOption in LazFindSearchOptionsDefault)
|
||||
then
|
||||
Include(FFindOptions,FindOption);
|
||||
end;
|
||||
LoadSearchOptions(XMLConfig, Path); // Search Options depend on SynEdit.
|
||||
|
||||
// file dialog
|
||||
with FFileDialogSettings do begin
|
||||
@ -514,7 +484,6 @@ procedure TInputHistories.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: str
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
FIFOption: TLazFindInFileSearchOption;
|
||||
FindOption: TSynSearchOption;
|
||||
begin
|
||||
// Find- and replace-history
|
||||
XMLConfig.SetDeleteValue(Path+'Find/History/Max',FMaxFindHistory,20);
|
||||
@ -532,12 +501,7 @@ begin
|
||||
FIFOption in FindInFilesSearchOptions,
|
||||
FIFOption in LazFindInFileSearchOptionsDefault);
|
||||
end;
|
||||
for FindOption:=Low(FFindOptions) to High(FFindOptions) do begin
|
||||
XMLConfig.SetDeleteValue(
|
||||
Path+'Find/Options/'+LazFindSearchOptionNames[FindOption],
|
||||
FindOption in FindOptions,
|
||||
FindOption in LazFindSearchOptionsDefault);
|
||||
end;
|
||||
SaveSearchOptions(XMLConfig, Path); // Search Options depend on SynEdit.
|
||||
|
||||
// file dialog
|
||||
with FFileDialogSettings do begin
|
||||
@ -617,8 +581,7 @@ begin
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
XMLConfig:=TXMLConfig.CreateClean(FFileName);
|
||||
XMLConfig.SetDeleteValue('InputHistory/Version/Value',
|
||||
InputHistoryVersion,0);
|
||||
XMLConfig.SetDeleteValue('InputHistory/Version/Value',InputHistoryVersion,0);
|
||||
SaveToXMLConfig(XMLConfig,'InputHistory/');
|
||||
XMLConfig.Flush;
|
||||
XMLConfig.Free;
|
||||
@ -693,7 +656,7 @@ begin
|
||||
if WorkDirectoryDialog.Execute then begin
|
||||
Result := WorkDirectoryDialog.Filename;
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(WorkDirectoryDialog);
|
||||
StoreFileDialogSettings(WorkDirectoryDialog);
|
||||
finally
|
||||
WorkDirectoryDialog.Free;
|
||||
end;
|
||||
@ -985,9 +948,5 @@ begin
|
||||
XMLConfig.SetDeleteValue(Path+'Count',i,0);
|
||||
end;
|
||||
|
||||
initialization
|
||||
InputHistories:= nil;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
116
ide/inputhistorywithsearchopt.pas
Normal file
116
ide/inputhistorywithsearchopt.pas
Normal file
@ -0,0 +1,116 @@
|
||||
{
|
||||
***************************************************************************
|
||||
* *
|
||||
* This source is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This code is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* A copy of the GNU General Public License is available on the World *
|
||||
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||
* obtain it by writing to the Free Software Foundation, *
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
Abstract:
|
||||
SynEdit (actually TSynSearchOptions) dependent parts separated from
|
||||
InputHistory unit. The idea is to reduce dependencies.
|
||||
}
|
||||
unit InputhistoryWithSearchOpt;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
// LazUtils
|
||||
Laz2_XMLCfg,
|
||||
// SynEdit
|
||||
SynEditTypes,
|
||||
// IDE
|
||||
InputHistory;
|
||||
|
||||
type
|
||||
|
||||
{ TInputHistoriesWithSearchOpt }
|
||||
|
||||
TInputHistoriesWithSearchOpt = class(TInputHistories)
|
||||
private
|
||||
FFindOptions: TSynSearchOptions;
|
||||
protected
|
||||
procedure LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string); override;
|
||||
procedure SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string); override;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
property FindOptions: TSynSearchOptions read FFindOptions write FFindOptions;
|
||||
end;
|
||||
|
||||
const
|
||||
LazFindSearchOptionNames: array[TSynSearchOption] of string = (
|
||||
'MatchCase',
|
||||
'WholeWord',
|
||||
'Backwards',
|
||||
'EntireScope',
|
||||
'SelectedOnly',
|
||||
'Replace',
|
||||
'ReplaceAll',
|
||||
'Prompt',
|
||||
'SearchInReplacement',
|
||||
'RegExpr',
|
||||
'RegExprMultiLine',
|
||||
'ssoFindContinue'
|
||||
);
|
||||
|
||||
var
|
||||
InputHistoriesSO: TInputHistoriesWithSearchOpt = nil;
|
||||
|
||||
implementation
|
||||
|
||||
{ TInputHistoriesWithSearchOpt }
|
||||
|
||||
constructor TInputHistoriesWithSearchOpt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
FFindOptions:=LazFindSearchOptionsDefault;
|
||||
end;
|
||||
|
||||
destructor TInputHistoriesWithSearchOpt.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TInputHistoriesWithSearchOpt.LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string);
|
||||
var
|
||||
FindOption: TSynSearchOption;
|
||||
begin
|
||||
FFindOptions:=[];
|
||||
for FindOption:=Low(FFindOptions) to High(FFindOptions) do
|
||||
begin
|
||||
if XMLConfig.GetValue(Path+'Find/Options/'+LazFindSearchOptionNames[FindOption],
|
||||
FindOption in LazFindSearchOptionsDefault)
|
||||
then
|
||||
Include(FFindOptions,FindOption);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TInputHistoriesWithSearchOpt.SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string);
|
||||
var
|
||||
FindOption: TSynSearchOption;
|
||||
begin
|
||||
for FindOption:=Low(FFindOptions) to High(FFindOptions) do begin
|
||||
XMLConfig.SetDeleteValue(
|
||||
Path+'Find/Options/'+LazFindSearchOptionNames[FindOption],
|
||||
FindOption in FindOptions,
|
||||
FindOption in LazFindSearchOptionsDefault);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -16,8 +16,6 @@
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
<TextName Value="CompanyName.ProductName.AppName"/>
|
||||
<TextDesc Value="Your application description."/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
@ -68,7 +66,7 @@
|
||||
<PackageName Value="SynEdit"/>
|
||||
</Item7>
|
||||
</RequiredPackages>
|
||||
<Units Count="241">
|
||||
<Units Count="242">
|
||||
<Unit0>
|
||||
<Filename Value="lazarus.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -532,6 +530,7 @@
|
||||
<Filename Value="buildprojectdlg.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<HasResources Value="True"/>
|
||||
<UnitName Value="BuildProjectDlg"/>
|
||||
</Unit75>
|
||||
<Unit76>
|
||||
<Filename Value="ideguicmdline.pas"/>
|
||||
@ -772,6 +771,7 @@
|
||||
<Unit119>
|
||||
<Filename Value="inputhistory.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="InputHistory"/>
|
||||
</Unit119>
|
||||
<Unit120>
|
||||
<Filename Value="makeresstrdlg.pas"/>
|
||||
@ -811,6 +811,7 @@
|
||||
<Unit127>
|
||||
<Filename Value="buildmanager.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BuildManager"/>
|
||||
</Unit127>
|
||||
<Unit128>
|
||||
<Filename Value="basebuildmanager.pas"/>
|
||||
@ -1112,7 +1113,10 @@
|
||||
<Unit191>
|
||||
<Filename Value="viewunit_dlg.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="ViewUnitDialog"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="ViewUnit_Dlg"/>
|
||||
</Unit191>
|
||||
<Unit192>
|
||||
<Filename Value="codetoolsdefines.pas"/>
|
||||
@ -1181,7 +1185,10 @@
|
||||
<Unit206>
|
||||
<Filename Value="findinfilesdlg.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="LazFindInFilesDialog"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="FindInFilesDlg"/>
|
||||
</Unit206>
|
||||
<Unit207>
|
||||
<Filename Value="ideoptionsdlg.pas"/>
|
||||
@ -1230,6 +1237,7 @@
|
||||
<Filename Value="runparamsopts.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<HasResources Value="True"/>
|
||||
<UnitName Value="RunParamsOpts"/>
|
||||
</Unit216>
|
||||
<Unit217>
|
||||
<Filename Value="idetranslations.pas"/>
|
||||
@ -1351,6 +1359,11 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="DefinesGui"/>
|
||||
</Unit240>
|
||||
<Unit241>
|
||||
<Filename Value="inputhistorywithsearchopt.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="InputhistoryWithSearchOpt"/>
|
||||
</Unit241>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -146,7 +146,7 @@ uses
|
||||
KeyMapping, IDETranslations, IDEProcs, ExtToolDialog, ExtToolEditDlg,
|
||||
JumpHistoryView, DesktopManager, ExampleManager,
|
||||
BuildLazDialog, BuildProfileManager, BuildManager, CheckCompOptsForNewUnitDlg,
|
||||
MiscOptions, InputHistory, UnitDependencies,
|
||||
MiscOptions, InputHistory, InputhistoryWithSearchOpt, UnitDependencies,
|
||||
IDEFPCInfo, IDEInfoDlg, IDEInfoNeedBuild, ProcessList, InitialSetupDlgs,
|
||||
InitialSetupProc, NewDialog, MakeResStrDlg, DialogProcs, FindReplaceDialog,
|
||||
FindInFilesDlg, CodeExplorer, BuildFileDlg, ProcedureList, ExtractProcDlg,
|
||||
@ -1353,10 +1353,12 @@ begin
|
||||
|
||||
DebuggerOptions := TDebuggerOptions.Create;
|
||||
|
||||
MainBuildBoss.SetupInputHistories;
|
||||
Assert(InputHistories = nil, 'TMainIDE.LoadGlobalOptions: InputHistories is already assigned.');
|
||||
InputHistoriesSO := TInputHistoriesWithSearchOpt.Create;
|
||||
InputHistories := InputHistoriesSO;
|
||||
MainBuildBoss.SetupInputHistories(InputHistories);
|
||||
|
||||
CreateDirUTF8(GetProjectSessionsConfigPath);
|
||||
|
||||
RunBootHandlers(libhEnvironmentOptionsLoaded);
|
||||
end;
|
||||
|
||||
|
@ -74,11 +74,11 @@ uses
|
||||
IDECmdLine, LazarusIDEStrConsts, IDECommands, EditorOptions, EnvironmentOpts,
|
||||
WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs, IDEHelpManager,
|
||||
MacroPromptDlg, TransferMacros, CodeContextForm, SrcEditHintFrm, etMessagesWnd,
|
||||
etSrcEditMarks, InputHistory, CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
etSrcEditMarks, CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
editor_general_options, SortSelectionDlg, EncloseSelectionDlg, EncloseIfDef,
|
||||
InvertAssignTool, SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
|
||||
MultiPasteDlg, EditorMacroListViewer, EditorToolbarStatic, editortoolbar_options,
|
||||
FPDocHints, MainIntf, GotoFrm, BaseDebugManager, Debugger;
|
||||
InputhistoryWithSearchOpt, FPDocHints, MainIntf, GotoFrm, BaseDebugManager, Debugger;
|
||||
|
||||
type
|
||||
TSourceNotebook = class;
|
||||
@ -3338,12 +3338,12 @@ begin
|
||||
NewOptions := NewOptions + [ssoReplace, ssoReplaceAll]
|
||||
else
|
||||
NewOptions := NewOptions - [ssoReplace, ssoReplaceAll];
|
||||
NewOptions:=NewOptions-SaveOptions+InputHistories.FindOptions*SaveOptions
|
||||
NewOptions:=NewOptions-SaveOptions+InputHistoriesSO.FindOptions*SaveOptions
|
||||
-[ssoSelectedOnly, ssoEntireScope];
|
||||
|
||||
// Fill in history items
|
||||
LazFindReplaceDialog.TextToFindComboBox.Items.Assign(InputHistories.FindHistory);
|
||||
LazFindReplaceDialog.ReplaceTextComboBox.Items.Assign(InputHistories.ReplaceHistory);
|
||||
LazFindReplaceDialog.TextToFindComboBox.Items.Assign(InputHistoriesSO.FindHistory);
|
||||
LazFindReplaceDialog.ReplaceTextComboBox.Items.Assign(InputHistoriesSO.ReplaceHistory);
|
||||
|
||||
with EditorComponent do begin
|
||||
if SelAvail then
|
||||
@ -3367,10 +3367,10 @@ begin
|
||||
LazFindReplaceDialog.FindText:='';
|
||||
end;
|
||||
end;
|
||||
LazFindReplaceDialog.EnableAutoComplete:=InputHistories.FindAutoComplete;
|
||||
LazFindReplaceDialog.EnableAutoComplete:=InputHistoriesSO.FindAutoComplete;
|
||||
// if there is no FindText, use the most recently used FindText
|
||||
if (LazFindReplaceDialog.FindText='') and (InputHistories.FindHistory.Count > 0) then
|
||||
LazFindReplaceDialog.FindText:=InputHistories.FindHistory[0];
|
||||
if (LazFindReplaceDialog.FindText='') and (InputHistoriesSO.FindHistory.Count > 0) then
|
||||
LazFindReplaceDialog.FindText:=InputHistoriesSO.FindHistory[0];
|
||||
|
||||
GetDialogPosition(LazFindReplaceDialog.Width,LazFindReplaceDialog.Height,ALeft,ATop);
|
||||
LazFindReplaceDialog.Left:=ALeft;
|
||||
@ -3378,17 +3378,17 @@ begin
|
||||
|
||||
LazFindReplaceDialog.Options := NewOptions;
|
||||
DlgResult:=LazFindReplaceDialog.ShowModal;
|
||||
InputHistories.FindOptions:=LazFindReplaceDialog.Options*SaveOptions;
|
||||
InputHistories.FindAutoComplete:=LazFindReplaceDialog.EnableAutoComplete;
|
||||
InputHistoriesSO.FindOptions:=LazFindReplaceDialog.Options*SaveOptions;
|
||||
InputHistoriesSO.FindAutoComplete:=LazFindReplaceDialog.EnableAutoComplete;
|
||||
if DlgResult = mrCancel then
|
||||
exit;
|
||||
//debugln('TSourceEditor.StartFindAndReplace B LazFindReplaceDialog.FindText="',dbgstr(LazFindReplaceDialog.FindText),'"');
|
||||
|
||||
Replace:=ssoReplace in LazFindReplaceDialog.Options;
|
||||
if Replace then
|
||||
InputHistories.AddToReplaceHistory(LazFindReplaceDialog.ReplaceText);
|
||||
InputHistories.AddToFindHistory(LazFindReplaceDialog.FindText);
|
||||
InputHistories.Save;
|
||||
InputHistoriesSO.AddToReplaceHistory(LazFindReplaceDialog.ReplaceText);
|
||||
InputHistoriesSO.AddToFindHistory(LazFindReplaceDialog.FindText);
|
||||
InputHistoriesSO.Save;
|
||||
DoFindAndReplace(LazFindReplaceDialog.FindText, LazFindReplaceDialog.ReplaceText,
|
||||
LazFindReplaceDialog.Options);
|
||||
end;
|
||||
@ -6473,7 +6473,7 @@ begin
|
||||
SrcEdit.CodeBuffer.DiskEncoding:=NewEncoding;
|
||||
SrcEdit.CodeBuffer.Modified:=true;
|
||||
// set override
|
||||
InputHistories.FileEncodings[SrcEdit.CodeBuffer.Filename]:=NewEncoding;
|
||||
InputHistoriesSO.FileEncodings[SrcEdit.CodeBuffer.Filename]:=NewEncoding;
|
||||
DebugLn(['TSourceNotebook.EncodingClicked Change file to ',SrcEdit.CodeBuffer.DiskEncoding]);
|
||||
if (not SrcEdit.CodeBuffer.IsVirtual)
|
||||
and (LazarusIDE.DoSaveEditorFile(SrcEdit, []) <> mrOk)
|
||||
@ -6492,7 +6492,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
// set override
|
||||
InputHistories.FileEncodings[SrcEdit.CodeBuffer.Filename]:=NewEncoding;
|
||||
InputHistoriesSO.FileEncodings[SrcEdit.CodeBuffer.Filename]:=NewEncoding;
|
||||
if not SrcEdit.CodeBuffer.Revert then begin
|
||||
IDEMessageDialog(lisCodeToolsDefsReadError,
|
||||
Format(lisUnableToRead, [SrcEdit.CodeBuffer.Filename]),
|
||||
|
Loading…
Reference in New Issue
Block a user