Skip to content

Commit

Permalink
Merge 06f5e0f into e469f5b
Browse files Browse the repository at this point in the history
  • Loading branch information
hiunnhue committed Aug 1, 2017
2 parents e469f5b + 06f5e0f commit ec732c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/chewingio.c
Expand Up @@ -929,6 +929,9 @@ CHEWING_API int chewing_handle_Enter(ChewingContext *ctx)
pgdata->chiSymbolCursor = buf;
pgdata->PointStart = -1;
pgdata->PointEnd = 0;
MakeOutputWithRtn(pgo, pgdata, keystrokeRtn);
MakeOutputAddMsgAndCleanInterval(pgo, pgdata);
return 0;
} else {
keystrokeRtn = KEYSTROKE_COMMIT;
WriteChiSymbolToCommitBuf(pgdata, pgo, nCommitStr);
Expand Down
6 changes: 6 additions & 0 deletions test/test-userphrase.c
Expand Up @@ -39,6 +39,8 @@ void test_ShiftLeft_add_userphrase()
{
static const char phrase[] = "\xE6\xB8\xAC\xE8\xA9\xA6" /* 測試 */ ;
static const char bopomofo[] = "\xE3\x84\x98\xE3\x84\x9C\xCB\x8B \xE3\x84\x95\xCB\x8B" /* ㄘㄜˋ ㄕˋ */ ;
static const char msg[] = "\xE5\x8A\xA0\xE5\x85\xA5\xEF\xBC\x9A\xE6\xB8\xAC\xE8\xA9\xA6" /* 加入:測試 */ ;

int cursor;
ChewingContext *ctx;

Expand All @@ -55,6 +57,7 @@ void test_ShiftLeft_add_userphrase()
cursor = chewing_cursor_Current(ctx);
ok(cursor == 0, "cursor position `%d' shall be 0", cursor);
ok(has_userphrase(ctx, bopomofo, phrase) == 1, "`%s' shall be in userphrase", phrase);
ok_aux_buffer(ctx, msg);

chewing_delete(ctx);
}
Expand All @@ -81,6 +84,8 @@ void test_ShiftRight_add_userphrase()
{
static const char phrase[] = "\xE6\xB8\xAC\xE8\xA9\xA6" /* 測試 */ ;
static const char bopomofo[] = "\xE3\x84\x98\xE3\x84\x9C\xCB\x8B \xE3\x84\x95\xCB\x8B" /* ㄘㄜˋ ㄕˋ */ ;
static const char msg[] = "\xE5\x8A\xA0\xE5\x85\xA5\xEF\xBC\x9A\xE6\xB8\xAC\xE8\xA9\xA6" /* 加入:測試 */ ;

int cursor;
ChewingContext *ctx;

Expand All @@ -97,6 +102,7 @@ void test_ShiftRight_add_userphrase()
cursor = chewing_cursor_Current(ctx);
ok(cursor == 2, "cursor position `%d' shall be 2", cursor);
ok(has_userphrase(ctx, bopomofo, phrase) == 1, "`%s' shall be in userphrase", phrase);
ok_aux_buffer(ctx, msg);

chewing_delete(ctx);
}
Expand Down

0 comments on commit ec732c4

Please sign in to comment.