Skip to content

Commit 60a45e4

Browse files
committed
Use the "repeat count" field to multiply white spaces.
1 parent 6b8709e commit 60a45e4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

reactive_dlg.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,10 @@ LRESULT CALLBACK text_box_hook(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
958958
case WM_CHAR:
959959
if (auto cnt = replace_tab_with_spaces(static_cast<wchar_t>(wparam), hwnd); cnt >= 0) {
960960
// replace the message with the specified number of white space inputs.
961-
while (--cnt >= 0)
962-
::SendMessageW(hwnd, WM_CHAR, static_cast<WPARAM>(L' '), lparam);
961+
if (cnt > 0)
962+
// multiply the "repeat count" field in lparam to populate white spaces.
963+
::SendMessageW(hwnd, WM_CHAR, static_cast<WPARAM>(L' '),
964+
(lparam & 0xffff0000) | (0xffff & ((lparam & 0xffff) * cnt)));
963965
return 0;
964966
}
965967
break;
@@ -1328,7 +1330,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
13281330
// 看板.
13291331
////////////////////////////////
13301332
#define PLUGIN_NAME "Reactive Dialog"
1331-
#define PLUGIN_VERSION "v1.11-beta3"
1333+
#define PLUGIN_VERSION "v1.11-beta4"
13321334
#define PLUGIN_AUTHOR "sigma-axis"
13331335
#define PLUGIN_INFO_FMT(name, ver, author) (name##" "##ver##" by "##author)
13341336
#define PLUGIN_INFO PLUGIN_INFO_FMT(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

0 commit comments

Comments
 (0)