Skip to content

Commit

Permalink
conhost: add a regex check box that enables regex search
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed May 30, 2024
1 parent c4390c6 commit fc8bb05
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ FILTERONPASTE
FINDCASE
FINDDLG
FINDDOWN
FINDREGEX
FINDSTRINGEXACT
FINDUP
FIter
Expand Down
1 change: 1 addition & 0 deletions src/host/res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ BEGIN
EDITTEXT ID_CONSOLE_FINDSTR, 47, 7, 128, 12, WS_GROUP | WS_TABSTOP | ES_AUTOHSCROLL

AUTOCHECKBOX "Match &case", ID_CONSOLE_FINDCASE, 4, 42, 64, 12
AUTOCHECKBOX "Regula&r expression", ID_CONSOLE_FINDREGEX, 4, 28, 96, 12

GROUPBOX "Direction", -1, 107, 26, 68, 28, WS_GROUP
AUTORADIOBUTTON "&Up", ID_CONSOLE_FINDUP, 111, 38, 25, 12, WS_GROUP
Expand Down
1 change: 1 addition & 0 deletions src/host/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ Author(s):
#define ID_CONSOLE_FINDCASE 602
#define ID_CONSOLE_FINDUP 603
#define ID_CONSOLE_FINDDOWN 604
#define ID_CONSOLE_FINDREGEX 605

// clang-format on
2 changes: 2 additions & 0 deletions src/interactivity/win32/find.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ INT_PTR CALLBACK FindDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM l
SetWindowLongPtrW(hWnd, DWLP_USER, lParam);
CheckRadioButton(hWnd, ID_CONSOLE_FINDUP, ID_CONSOLE_FINDDOWN, (reverse ? ID_CONSOLE_FINDUP : ID_CONSOLE_FINDDOWN));
CheckDlgButton(hWnd, ID_CONSOLE_FINDCASE, WI_IsFlagClear(flags, SearchFlag::CaseInsensitive));
CheckDlgButton(hWnd, ID_CONSOLE_FINDREGEX, WI_IsFlagSet(flags, SearchFlag::RegularExpression));
SetDlgItemTextW(hWnd, ID_CONSOLE_FINDSTR, lastFindString.c_str());
return TRUE;
case WM_COMMAND:
Expand All @@ -47,6 +48,7 @@ INT_PTR CALLBACK FindDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM l
lastFindString.resize(length);

WI_UpdateFlag(flags, SearchFlag::CaseInsensitive, IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDCASE) == 0);
WI_UpdateFlag(flags, SearchFlag::RegularExpression, IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDREGEX) != 0);
reverse = IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDDOWN) == 0;

LockConsole();
Expand Down
1 change: 1 addition & 0 deletions src/interactivity/win32/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ Author(s):
#define ID_CONSOLE_FINDCASE 602
#define ID_CONSOLE_FINDUP 603
#define ID_CONSOLE_FINDDOWN 604
#define ID_CONSOLE_FINDREGEX 605

// clang-format on

0 comments on commit fc8bb05

Please sign in to comment.