From c72de70dff1d93134d71a3b8a07b82661065d71c Mon Sep 17 00:00:00 2001 From: maboroshin Date: Wed, 19 Sep 2018 01:38:33 +0900 Subject: [PATCH] fix:Notepad3.c IME AutoComp --- src/Notepad3.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index 30fbf97a8..c72e2c9f3 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -6150,9 +6150,9 @@ static void __fastcall _HandleTinyExpr() #if 0 //============================================================================= // -// _IsIMEOpenInNativeMode() +// _IsIMEOpenInNoNativeMode() // -static bool __fastcall _IsIMEOpenInNativeMode() +static bool __fastcall _IsIMEOpenInNoNativeMode() { bool result = false; HIMC const himc = ImmGetContext(g_hwndEdit); @@ -6365,10 +6365,17 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) } if ((g_bAutoCompleteWords || g_bAutoCLexerKeyWords)) { - if (g_bAutoCinASCIIModeOnly && ((ich > 0x7F) || (scn->modifiers != SC_CHARADDED_NORMAL))) { - SciCall_AutoCCancel(); - return 0LL; - } + //if (g_bAutoCinASCIIModeOnly && (ich > 0x7F) ) { + bool isIMEModeActive, + bIMEOpen = (bool)SendMessage(g_hwndEdit, SCI_GETIMEOPEN, 0, 0); + if (bIMEOpen) { // || (scn->modifiers != SC_CHARADDED_NORMAL) + isIMEModeActive = (bool)SendMessage(g_hwndEdit, SCI_GETIMEMODEACTIVE, 0, 0); + if (isIMEModeActive ) { + SciCall_AutoCCancel(); + return 0LL; + } + } + //} //g_bAutoCinASCIIModeOnly section if (!SciCall_AutoCActive()) { EditCompleteWord(g_hwndEdit, false); } } }