From 8ef9446100e0d327462182b930ceb9a48522c28d Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 26 Feb 2021 08:30:07 +0100 Subject: [PATCH] + fix: Wrap-Around tooltip use correct encoding --- src/Notepad3.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index 7bf918b16..9efec6e32 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -8775,7 +8775,6 @@ void UpdateStatusbar(bool bForceRedraw) //============================================================================= -const static char* const FR_StatusA[] = { "[>--<]", "[>>--]", "[>>-+]", "[+->]>", "[--<<]", "[+-<<]", "<[<-+]"}; const static WCHAR* const FR_StatusW[] = { L"[>--<]", L"[>>--]", L"[>>-+]", L"[+->]>", L"[--<<]", L"[+-<<]", L"<[<-+]"}; static void _UpdateStatusbarDelayed(bool bForceRedraw) @@ -11137,16 +11136,17 @@ void ShowZoomCallTip() void ShowWrapAroundCallTip(bool forwardSearch) { int const delayClr = Settings2.WrapAroundTooltipTimeout; - if (delayClr >= (10*USER_TIMER_MINIMUM)) { - char chToolTipFmt[64] = { '\0' }; - static char chToolTip[80] = { '\0' }; + if (delayClr >= (USER_TIMER_MINIMUM<<4)) { + WCHAR wchToolTipFmt[64] = { '\0' }; + WCHAR wchToolTip[80] = { '\0' }; + static char chToolTip[80*3] = { '\0' }; if (forwardSearch) { - GetLngStringA(IDS_MUI_WRAPSEARCH_FWD, chToolTipFmt, COUNTOF(chToolTipFmt)); + GetLngString(IDS_MUI_WRAPSEARCH_FWD, wchToolTipFmt, COUNTOF(wchToolTipFmt)); } else { - GetLngStringA(IDS_MUI_WRAPSEARCH_BCK, chToolTipFmt, COUNTOF(chToolTipFmt)); + GetLngString(IDS_MUI_WRAPSEARCH_BCK, wchToolTipFmt, COUNTOF(wchToolTipFmt)); } - StringCchPrintfA(chToolTip, COUNTOF(chToolTip), chToolTipFmt, FR_StatusA[Globals.FindReplaceMatchFoundState]); - + StringCchPrintf(wchToolTip, COUNTOF(wchToolTip), wchToolTipFmt, FR_StatusW[Globals.FindReplaceMatchFoundState]); + WideCharToMultiByte(Encoding_SciCP, 0, wchToolTip, -1, chToolTip, (int)COUNTOF(chToolTip), NULL, NULL); SciCall_CallTipShow(SciCall_GetCurrentPos(), chToolTip); _DelayClearCallTip(delayClr); } else {