engine: nothing pending is no reading, and reaches into nothing

startsearch let reachback walk the client's text whenever Ctrl+H found
im.sel < 0, without asking whether anything was pending, so a Ctrl+H
pressed to begin a reading took the syllables already written instead.
With the cursor after 입니다 the query became 다, the preedit showed
nothing at all, and Space committed 多 over the 다 the user had written;
typing the reading the key was pressed for gave 다한, so 입니다漢 came
out 입니多恨.  A reading is what is pending, and there is none.

The seeded reach is untouched: 한 committed with 자 pending still
converts 한자 as a word and takes the 한 back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 16:02:27 +09:00
parent cf0eba6642
commit b08f3bb7a2
2 changed files with 19 additions and 1 deletions

View File

@@ -793,7 +793,9 @@ startsearch(int lang, Str *com)
sclear(&seed);
if(lang == LangHANJA && !search.lang && im.sel < 0){
impre(&im, &seed);
reachback(&seed, &back);
/* Nothing pending is no reading, and reaches into nothing. */
if(seed.n != 0)
reachback(&seed, &back);
}else
flush(com);
reset();