This feature request has added issues over time. The original issue is stated here:
See the screenshort (Pinyin IME in Chrome), and some screenshorts on https://sourceforge.net/p/scintilla/bugs/2038/
At least Chinese with Pinyin IME is more like the candidate window not moved on typing, not been distracted by the moved window: the position for the best candidate item (most likely first one) is at a consistent position on typing, making pick the item easy; otherwise more time will be spent on the candidate window to watch the position changes.
There are 5 candidate window improvements discussed on this feature request along with some other IME issues.
1) Stop candidate window overlapping composition text and taskbar.
2) Position candidate window closer to composition text.
3) Stop candidate window moving while typing.
4) Align candidate window to target part of composition text.
5) Stop Google IME on Windows 7 moving while typing.
(1) was extracted into a bug [#2120].
Bugs: #2120
Bugs: #2135
Bugs: #2137
Bugs: #2391
Feature Requests: #1304
Feature Requests: #1488
scintilla does nothing to candidate window position.
just informs Ime of character position being input.
the position of candidate window is set by Ime with the above info.
No, it moved see the screenshot.
On Windows, it was caused by the call SetCandidateWindowPos() in ScintillaWin::HandleCompositionInline().
If the call is moved to WM_IME_STARTCOMPOSITION, it will stay at the starting position.
I think this happens on GTK too, where ScintillaWin::HandleCompositionInline() => ScintillaGTK::PreeditChangedInlineThis() and WM_IME_STARTCOMPOSITION => preedit-start.
Se the change to scintilla/win32/ScintillaWin.cxx at https://github.com/zufuliu/notepad2/commit/442308f0e19bedeb0cc1bb5b3f56daa6038f6ceb#diff-3116791c8fff3a31032997bb45378493R1053
Ignore the change to
CandForm.ptCurrentPos.y = static_cast<LONG>(pos.y + vs.lineHeight);, the candidate window looks far from caret line by adding vs.lineHeight (I think 4px offset would enough) like in https://sourceforge.net/p/scintilla/bugs/2038/#860fHow about this code?
CandForm.ptCurrentPos.y = static_cast<long>(KoreanIme() ? pos.y + vs.lineHeight : pos.y);</long>
I also like this approach too.
I think it will not influence on korean since input position of korean never moves while in composition until ending composition.
Only call SetCandidateWindowPos() when composition ending like:
or call it in WM_IME_ENDCOMPOSITION.
What's the purpose to move candidate window when composition ending? from my experience, the candidate window will disappear when composition finished.
Please do not get me wrong.
I mean you may be right.
As you pointed, Moving SetCandidateWindowPos() from ScintillaWin::HandleCompositionInline() into WM_IME_STARTCOMPOSITION may give no impact on korean ime.
Sorry it needs time to update my old developing environment.
After read somewhere, I got that some IME not send WM_IME_STARTCOMPOSITION, but WM_IME_COMPOSITION with GCS_COMPSTR on starting composition.
So that SetCandidateWindowPos() can't be removed from HandleCompositionInline().
CandForm.ptCurrentPos.y = static_cast<long>(pos.y + vs.lineHeight);</long>
pos.y + vs.lineHeight was temporarily made against a bug of windows native korean ime.
Your patch will make korean user not see their editing line downside by vs.lineHeight*3/4
In addition, this code still can not cope with the last editing line.
I suggest you introduce ChineseIme() if you want enhance chinese ime.
I hope more chinese and japanese would join in to enhance their ime.
I started KoreanIme() not to give influence on other language users.
Last edit: johnsonj 2019-06-28
Windowed ime is not my reference model.
not moving box is window ime bug.
case WM_IME_STARTCOMPOSITION: // dbcs
if (imeInteraction == imeInline) {
SetCandidateWindowPos();
return 0;
} else {
it is a good point.
but I would like to do this.
case WM_IME_STARTCOMPOSITION:
SetCandidateWindowPos();
You can see the right behaviors of windowed ime.
Last edit: johnsonj 2019-06-28
This has no effect for windowed ime. it's not moved, that why it been moved into imeInline block, without it, the candidate window is at it's default position (like window mode).
The change to
CandForm.ptCurrentPos.ycan be discussed further.The current discussion is adding a option (default enabled) to conditional call SetCandidateWindowPos() in HandleCompositionInline() like
The candidate window not moving is not a bug at least for Chinese IME, see the screenshots for IMEs on macOS (all in inline mode) at https://sourceforge.net/p/scintilla/bugs/2038/?page=1&limit=25#954d
Yes, I understand.
The korean candidate box is not moving either.
I am sorry I confused candidate box with editing box.
Korean candidate box should be shown at down under editing box.
Can you give a screeenshot about Korean IME?
I'm confused which is the editing box?
See my screenshots above, for Chinese Pinyin IME,
the composition window is the window that contains Pinyin letters and separators, in above screenshot, it's the window or area in Scintilla contains
z'z'z'z'z'z'z'z'z'z'z'z'z'z'z'z'z'z'z;the candidate window is the window that has first item been highlighted with green color, and contains numbered items that can be picked from.
From https://docs.microsoft.com/en-us/windows/desktop/DxTechArts/installing-and-using-input-method-editors
the candidate window is near composition window/area for all IME, not one line below; except when doing Hanja conversion, which seems a bug like this https://sourceforge.net/p/scintilla/bugs/2038/?page=1&limit=25#5324
Korean windowed ime box always is positioned at upLeft corner.
Up box is for editing.
Down box is candidate box.
The thin vertical caret at code blocks indicates the position being input.
So windowed Korean IME completely displayed outside application window, that's why you need hard-coded inline mode.
How about inline mode Korean IME in Chrome and code blocks? Is the candidate box on third line like:
or
Is candidate box still in vertical mode, like that in windowed mode.
inline mode has no edit box.
it inserts and deletes into documents tentatively.
code blocks has no inline ime feature.
Here is a screen shot on chrome.
OK, I forgotten that code blocks is written in wxWidgets.
So that, the candidate box is immediately below edit box, no need vs.lineHeight (one line offset), It's should looks like (which is same as Chinese Pinyin IME):
Can you test Notepad2, disable "Settings" => "Inline IME Options" => "Move Candidate Window On Typing", See if it the inline IME works as expected (like it in Chrome and other applications). Thanks.
64-bit at https://ci.appveyor.com/project/zufuliu/notepad2/build/job/ptd3jfsxnglnw4bn/artifacts
32-bit at https://ci.appveyor.com/project/zufuliu/notepad2/build/job/j1l9ijq5fwqgeuwd/artifacts
Please also test Windows SciTE at https://www.scintilla.org/SciTEDownload.html
On Windows, SciTE for Korean always use inline mode. The screenshot is what I got for Chinese Pinyin IME, which not works as expected.
Chinese inline ime of scintilla is similiar with MS WORD.
https://youtu.be/ywE-K4qK94g
Thanks, sadly I can't see the video.
I can not see it either on firefox under windows xp.
I will try it under windows 7.
it looks like windows native notepad.
OK! firefox under window7.
Is there some way to download your notepad2 without AppVeyor?
Source code at https://github.com/zufuliu/notepad2
https://github.com/zufuliu/notepad2/wiki/Build-Notepad2
https://ci.appveyor.com/api/buildjobs/8in88ksgl4xm5ikf/artifacts/build%2FNotepad2_Win32_v4.19.06r2148.zip
https://ci.appveyor.com/api/buildjobs/v6uoa7o0g4lbags0/artifacts/build%2FNotepad2_x64_v4.19.06r2148.zip
How about Korean IME in latest AppVeyor build Notepad2 or SciTE?
https://sourceforge.net/p/scintilla/feature-requests/1300/#81e2/0ace/d7f8/ac94/7276/3b42/43d4