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
Dir: String;
begin
if ReplaceCheckBox.Checked then
InputHistories.AddToReplaceHistory(ReplaceText);
InputHistories.AddToFindHistory(FindText);
Dir:=AppendPathDelim(TrimFilename(DirectoriesComboBox.Text));
if Dir<>'' then

View File

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

View File

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