find all, project scope, fine tweaks

This commit is contained in:
Basile Burg 2016-01-27 01:34:31 +01:00
parent 3fdbf6b4be
commit 7d6e2863cd
2 changed files with 8 additions and 8 deletions

View File

@ -78,7 +78,7 @@ inherited CESearchWidget: TCESearchWidget
object btnReplace: TBitBtn[2] object btnReplace: TBitBtn[2]
Left = 4 Left = 4
Height = 24 Height = 24
Top = 195 Top = 231
Width = 385 Width = 385
Align = alBottom Align = alBottom
BorderSpacing.Around = 4 BorderSpacing.Around = 4
@ -270,7 +270,7 @@ inherited CESearchWidget: TCESearchWidget
object Panel2: TPanel[6] object Panel2: TPanel[6]
Left = 0 Left = 0
Height = 32 Height = 32
Top = 223 Top = 195
Width = 393 Width = 393
Align = alBottom Align = alBottom
BevelOuter = bvNone BevelOuter = bvNone

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes, Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes,
ce_common, ce_mru, ce_widget, ce_synmemo, ce_interfaces, ce_observer, ce_common, ce_mru, ce_widget, ce_synmemo, ce_interfaces, ce_observer,
ce_writableComponent, ce_dialogs, ce_sharedres; ce_writableComponent, ce_dialogs, ce_sharedres, SynEditTextBuffer;
type type
@ -287,7 +287,7 @@ end;
procedure TCESearchWidget.actFindAllExecute(sender: TObject); procedure TCESearchWidget.actFindAllExecute(sender: TObject);
var var
i: integer; i: integer;
syn: TSynEdit; lst: TSynEditStringList;
fnm: string; fnm: string;
begin begin
if fDoc.isNil and not fAllInProj then if fDoc.isNil and not fAllInProj then
@ -300,16 +300,16 @@ begin
// //
if fAllInProj then if fAllInProj then
begin begin
syn := TSynEdit.Create(nil); lst := TSynEditStringList.Create;
try try
for i := 0 to fProj.sourcesCount-1 do for i := 0 to fProj.sourcesCount-1 do
begin begin
fnm := fProj.sourceAbsolute(i); fnm := fProj.sourceAbsolute(i);
syn.Lines.LoadFromFile(fnm); lst.LoadFromFile(fnm);
findAll(fnm, syn.Lines); findAll(fnm, lst);
end; end;
finally finally
syn.Free; lst.Free;
end; end;
end end
else findAll(fDoc.fileName, fDoc.Lines); else findAll(fDoc.fileName, fDoc.Lines);