fix(engine): the search keys commit the query they end or replace
Ctrl+E during an emoji search, Ctrl+H during a hanja search, or either during the other search dropped the typed query, while every other Ctrl key committed it as the README says. Escape is the way to cancel; the search keys now commit the shown text like a language switch.
This commit is contained in:
29
strans.c
29
strans.c
@@ -556,15 +556,6 @@ endsearch(void)
|
||||
clearkouho();
|
||||
}
|
||||
|
||||
/* A search commits any pending composition and takes over the keys. */
|
||||
static void
|
||||
startsearch(int lang, Str *com)
|
||||
{
|
||||
commit(com);
|
||||
endsearch();
|
||||
search.lang = lang;
|
||||
}
|
||||
|
||||
static void
|
||||
commitsearch(Str *com)
|
||||
{
|
||||
@@ -572,6 +563,15 @@ commitsearch(Str *com)
|
||||
endsearch();
|
||||
}
|
||||
|
||||
/* A search commits whatever is pending and takes over the keys. */
|
||||
static void
|
||||
startsearch(int lang, Str *com)
|
||||
{
|
||||
commit(com);
|
||||
commitsearch(com);
|
||||
search.lang = lang;
|
||||
}
|
||||
|
||||
static void
|
||||
picksearch(int n, Str *com)
|
||||
{
|
||||
@@ -639,15 +639,12 @@ searchkey(u32int ks, u32int mod, Str *com)
|
||||
if(mod & Mctrl){
|
||||
c = ctrlkey(ks);
|
||||
n = searchlang(c);
|
||||
if(n == search.lang)
|
||||
endsearch();
|
||||
else if(n != 0)
|
||||
if(n != 0 && n != search.lang){
|
||||
startsearch(n, com);
|
||||
else{
|
||||
commitsearch(com);
|
||||
return setlang(c);
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
commitsearch(com);
|
||||
return n != 0 || setlang(c);
|
||||
}
|
||||
if(search.raw.n >= Maxrunes){
|
||||
commitsearch(com);
|
||||
|
||||
Reference in New Issue
Block a user