Skip to content

Commit

Permalink
Give focus back when blind search is attempted
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo committed Sep 14, 2024
1 parent ce31cc6 commit 2ac76d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -1072,13 +1072,16 @@ struct MyFrame : wxFrame {
}

void OnSearch(wxCommandEvent &ce) {
if (!sys->showtoolbar) return;
TSCanvas *sw = GetCurTab();
if (!sys->showtoolbar) {
sw->SetFocus();
return;
}
wxString searchstring = ce.GetString();
sys->darkennonmatchingcells = searchstring.Len() != 0;
sys->searchstring = (sys->casesensitivesearch) ? searchstring : searchstring.Lower();
SetSearchTextBoxBackgroundColour(false);
Document *doc = GetCurTab()->doc;
TSCanvas *sw = GetCurTab();
wxClientDC dc(sw);
doc->SearchNext(dc, false, false, false);
if (doc->searchfilter) {
Expand All @@ -1089,8 +1092,11 @@ struct MyFrame : wxFrame {
}

void OnSearchReplaceEnter(wxCommandEvent &ce) {
if (!sys->showtoolbar) return;
TSCanvas *sw = GetCurTab();
if (!sys->showtoolbar) {
sw->SetFocus();
return;
}
if (ce.GetId() == A_SEARCH && ce.GetString().Len() == 0) {
sw->SetFocus();
} else {
Expand Down

0 comments on commit 2ac76d8

Please sign in to comment.