IDE: FindInFiles fixes. Issue #28293, patch from Ondrej Pokorny.

git-svn-id: trunk@49332 -
This commit is contained in:
juha 2015-06-14 21:38:31 +00:00
parent 7d7d06ceb7
commit 702d8751b0
3 changed files with 11 additions and 6 deletions

View File

@ -369,6 +369,8 @@ procedure TLazFindInFilesDialog.SaveHistory;
var var
Dir: String; Dir: String;
begin begin
if ReplaceCheckBox.Checked then
InputHistories.AddToReplaceHistory(ReplaceText);
InputHistories.AddToFindHistory(FindText); InputHistories.AddToFindHistory(FindText);
Dir:=AppendPathDelim(TrimFilename(DirectoriesComboBox.Text)); Dir:=AppendPathDelim(TrimFilename(DirectoriesComboBox.Text));
if Dir<>'' then if Dir<>'' then

View File

@ -8311,10 +8311,9 @@ var
AnEditorInfo: TUnitEditorInfo; AnEditorInfo: TUnitEditorInfo;
begin begin
Result:=false; Result:=false;
if pos('(',SearchResultsView.GetSelectedText) > 0 then AFileName:= SearchResultsView.GetSourceFileName;
if AFilename<>'' then
begin begin
AFileName:= SearchResultsView.GetSourceFileName;
if AFilename='' then exit;
LogCaretXY:= SearchResultsView.GetSourcePositon; LogCaretXY:= SearchResultsView.GetSourcePositon;
OpenFlags:=[ofOnlyIfExists,ofRegularFile]; OpenFlags:=[ofOnlyIfExists,ofRegularFile];
if MainBuildBoss.IsTestUnitFilename(AFilename) then begin if MainBuildBoss.IsTestUnitFilename(AFilename) then begin
@ -8391,6 +8390,8 @@ begin
SearchResultsView.DisableAutoSizing; SearchResultsView.DisableAutoSizing;
if State>=iwgfShow then if State>=iwgfShow then
IDEWindowCreators.ShowForm(SearchresultsView,State=iwgfShowOnTop); IDEWindowCreators.ShowForm(SearchresultsView,State=iwgfShowOnTop);
if SearchresultsView.SearchInListEdit.CanFocus then
SearchresultsView.SearchInListEdit.SetFocus;
end; end;
function TMainIDE.GetTestBuildDirectory: string; function TMainIDE.GetTestBuildDirectory: string;
@ -10057,8 +10058,8 @@ end;
function TMainIDE.DoFindInFiles: TModalResult; function TMainIDE.DoFindInFiles: TModalResult;
begin begin
Result:=mrOk;
FindInFilesDialog.FindInFilesPerDialog(Project1); FindInFilesDialog.FindInFilesPerDialog(Project1);
Result:=FindInFilesDialog.ModalResult;
end; end;
procedure TMainIDE.DoCompleteCodeAtCursor; procedure TMainIDE.DoCompleteCodeAtCursor;

View File

@ -448,7 +448,8 @@ begin
if Key = Char(VK_RETURN) then //SearchInListEdit passes only OnPress through if Key = Char(VK_RETURN) then //SearchInListEdit passes only OnPress through
begin begin
Key := #0; Key := #0;
FOnSelectionChanged(Self); if Assigned(FOnSelectionChanged) then
FOnSelectionChanged(Self);
end; end;
end; end;
@ -711,7 +712,8 @@ begin
if (Key = VK_RETURN) and (Shift = []) then if (Key = VK_RETURN) and (Shift = []) then
begin begin
Key:=VK_UNKNOWN; Key:=VK_UNKNOWN;
FOnSelectionChanged(Self); if Assigned(FOnSelectionChanged) then
FOnSelectionChanged(Self);
end; end;
end; end;