fix: forward input at the composition limit
This commit is contained in:
4
strans.c
4
strans.c
@@ -718,8 +718,10 @@ keystroke(u32int ks, u32int mod, Str *com)
|
|||||||
if(!haspre(&im))
|
if(!haspre(&im))
|
||||||
return 0;
|
return 0;
|
||||||
commit(com);
|
commit(com);
|
||||||
sputr(com, ks);
|
|
||||||
reset();
|
reset();
|
||||||
|
if(com->n >= Maxrunes)
|
||||||
|
return 0;
|
||||||
|
sputr(com, ks);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(im.l->trans == nil)
|
if(im.l->trans == nil)
|
||||||
|
|||||||
@@ -1280,3 +1280,33 @@ engine_randomized_stress(struct ct *t)
|
|||||||
emojiend(&f);
|
emojiend(&f);
|
||||||
vi->map = vimap;
|
vi->map = vimap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
engine_full_boundary_passthrough(struct ct *t)
|
||||||
|
{
|
||||||
|
Str com;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
init();
|
||||||
|
im.l = getlang(LangJP);
|
||||||
|
for(i = 0; i < Maxrunes; i++)
|
||||||
|
im.pre.r[i] = L'あ';
|
||||||
|
im.pre.n = Maxrunes;
|
||||||
|
sclear(&com);
|
||||||
|
CT_CHECK(t, !keystroke(' ', 0, &com));
|
||||||
|
CT_EQ_INT(t, Maxrunes, com.n);
|
||||||
|
for(i = 0; i < Maxrunes; i++)
|
||||||
|
CT_EQ_UINT(t, L'あ', com.r[i]);
|
||||||
|
CT_EQ_INT(t, 0, im.pre.n);
|
||||||
|
CT_EQ_INT(t, 0, im.raw.n);
|
||||||
|
|
||||||
|
init();
|
||||||
|
im.l = getlang(LangJP);
|
||||||
|
for(i = 0; i < Maxrunes-1; i++)
|
||||||
|
im.pre.r[i] = L'あ';
|
||||||
|
im.pre.n = Maxrunes-1;
|
||||||
|
sclear(&com);
|
||||||
|
CT_CHECK(t, keystroke(' ', 0, &com));
|
||||||
|
CT_EQ_INT(t, Maxrunes, com.n);
|
||||||
|
CT_EQ_UINT(t, ' ', com.r[Maxrunes-1]);
|
||||||
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ void engine_emoji_preedit_languages(struct ct*);
|
|||||||
void engine_emoji_start_and_unknown(struct ct*);
|
void engine_emoji_start_and_unknown(struct ct*);
|
||||||
void engine_emoji_dictionary_identity(struct ct*);
|
void engine_emoji_dictionary_identity(struct ct*);
|
||||||
void engine_randomized_stress(struct ct*);
|
void engine_randomized_stress(struct ct*);
|
||||||
|
void engine_full_boundary_passthrough(struct ct*);
|
||||||
void dictionary_candidates(struct ct*);
|
void dictionary_candidates(struct ct*);
|
||||||
void dictionary_misses_clear_result(struct ct*);
|
void dictionary_misses_clear_result(struct ct*);
|
||||||
void dictionary_emoji_identity(struct ct*);
|
void dictionary_emoji_identity(struct ct*);
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ static const struct ct_test tests[] = {
|
|||||||
{ "engine/emoji-start-and-unknown", engine_emoji_start_and_unknown },
|
{ "engine/emoji-start-and-unknown", engine_emoji_start_and_unknown },
|
||||||
{ "engine/emoji-dictionary-identity", engine_emoji_dictionary_identity },
|
{ "engine/emoji-dictionary-identity", engine_emoji_dictionary_identity },
|
||||||
{ "engine/randomized-stress", engine_randomized_stress },
|
{ "engine/randomized-stress", engine_randomized_stress },
|
||||||
|
{ "engine/full-boundary-passthrough", engine_full_boundary_passthrough },
|
||||||
{ "dict/candidates", dictionary_candidates },
|
{ "dict/candidates", dictionary_candidates },
|
||||||
{ "dict/misses-clear-result", dictionary_misses_clear_result },
|
{ "dict/misses-clear-result", dictionary_misses_clear_result },
|
||||||
{ "dict/emoji-identity", dictionary_emoji_identity },
|
{ "dict/emoji-identity", dictionary_emoji_identity },
|
||||||
|
|||||||
Reference in New Issue
Block a user