mirror of https://gitlab.com/basile.b/dexed.git
search & replace, find next, propose to restart from the doc beg/end if no match anymore
This commit is contained in:
parent
76365ede58
commit
d55932fbb3
|
@ -507,6 +507,10 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSearchWidget.actFindNextExecute(sender: TObject);
|
procedure TSearchWidget.actFindNextExecute(sender: TObject);
|
||||||
|
const
|
||||||
|
r: array[boolean] of string = ('beginning', 'end');
|
||||||
|
var
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
if fDoc.isNil then
|
if fDoc.isNil then
|
||||||
exit;
|
exit;
|
||||||
|
@ -533,7 +537,14 @@ begin
|
||||||
fDoc.CaretX := fDoc.CaretX + 1;
|
fDoc.CaretX := fDoc.CaretX + 1;
|
||||||
end;
|
end;
|
||||||
if fDoc.SearchReplace(fToFind, '', getOptions) = 0 then
|
if fDoc.SearchReplace(fToFind, '', getOptions) = 0 then
|
||||||
dlgOkInfo('the expression cannot be found')
|
begin
|
||||||
|
s := format('the expression cannot be found, restart from the %s ?', [r[chkBack.Checked]]);
|
||||||
|
if dlgOkCancel(s) = mrOk then
|
||||||
|
begin
|
||||||
|
chkFromCur.Checked:=false;
|
||||||
|
actFindNextExecute(nil);
|
||||||
|
end;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
fHasSearched := true;
|
fHasSearched := true;
|
||||||
|
|
Loading…
Reference in New Issue