sptr_t ScintillaWin::HandleCompositionWindowed(uptr_t wParam, sptr_t lParam) {
if (lParam & GCS_RESULTSTR) {
IMContext imc(MainHWND());
if (imc.hIMC) {
AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::ImeResult);
// Set new position after converted
const Point pos = PointMainCaret();
COMPOSITIONFORM CompForm {};
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos = POINTFromPoint(pos);
::ImmSetCompositionWindow(imc.hIMC, &CompForm);
}
return 0; }
return ::DefWindowProc(MainHWND(), WM_IME_COMPOSITION, wParam, lParam);
}
take note of return 0;
if both compStr and resultStr come in,
firstly insert resultStr
and ignore compStr.
I think flattenning "if structure" causes undifind behaviors.
2023년 5월 13일 토요일 오후 1시 41분 54초 UTC+9에 johnsonj님이 작성: