mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-26 15:08:18 +02:00
Applied the idea of a patch from Darek Mazur
git-svn-id: trunk@5378 -
This commit is contained in:
parent
2f10d4e852
commit
9f86a5a31f
@ -3416,8 +3416,8 @@ End;
|
|||||||
//FindInFiles
|
//FindInFiles
|
||||||
function TSourceNotebook.CreateFindInFilesDialog: TLazFindInFilesDialog;
|
function TSourceNotebook.CreateFindInFilesDialog: TLazFindInFilesDialog;
|
||||||
begin
|
begin
|
||||||
Result:=TLazFindInFilesDialog.Create(Application);
|
Result := TLazFindInFilesDialog.Create(Application);
|
||||||
LoadFindInFilesHistory(Result);
|
LoadFindInFilesHistory(Result);
|
||||||
end;//CreateFindInFilesDialog
|
end;//CreateFindInFilesDialog
|
||||||
|
|
||||||
procedure TSourceNotebook.LoadFindInFilesHistory(ADialog: TLazFindInFilesDialog);
|
procedure TSourceNotebook.LoadFindInFilesHistory(ADialog: TLazFindInFilesDialog);
|
||||||
@ -3560,9 +3560,27 @@ begin
|
|||||||
end;//FIFCreateSearchForm
|
end;//FIFCreateSearchForm
|
||||||
|
|
||||||
Procedure TSourceNotebook.FindInFiles(AProject: TProject);
|
Procedure TSourceNotebook.FindInFiles(AProject: TProject);
|
||||||
|
var
|
||||||
|
TempEditor: TSourceEditor;
|
||||||
Begin
|
Begin
|
||||||
if FindInFilesDialog=nil then
|
if FindInFilesDialog = nil
|
||||||
FindInFilesDialog:=CreateFindInFilesDialog;
|
then FindInFilesDialog := CreateFindInFilesDialog;
|
||||||
|
|
||||||
|
TempEditor := GetActiveSE;
|
||||||
|
if TempEditor <> nil
|
||||||
|
then with TempEditor, EditorComponent do
|
||||||
|
begin
|
||||||
|
if EditorOpts.FindTextAtCursor
|
||||||
|
then begin
|
||||||
|
if SelAvail and (BlockBegin.Y = BlockEnd.Y)
|
||||||
|
then FindInFilesDialog.FindText := SelText
|
||||||
|
else FindInFilesDialog.FindText := GetWordAtRowCol(CaretXY);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
FindInFilesDialog.FindText:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if FindInFilesDialog.ShowModal=mrOk then
|
if FindInFilesDialog.ShowModal=mrOk then
|
||||||
begin
|
begin
|
||||||
SaveFindInFilesHistory(FindInFilesDialog);
|
SaveFindInFilesHistory(FindInFilesDialog);
|
||||||
|
Loading…
Reference in New Issue
Block a user