Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Fix #239 ] Reset oldChiSymbolCursor in chewing_handle_Default #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/internal/chewingutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int SymbolChoice(ChewingData *pgdata, int sel_i);
int HaninSymbolInput(ChewingData *pgdata);
void WriteChiSymbolToCommitBuf(ChewingData *pgdata, ChewingOutput *pgo, int len);
int ReleaseChiSymbolBuf(ChewingData *pgdata, ChewingOutput *);
void ResetOldChiSymbolCursor(ChewingData *pgdata);
int AddChi(uint16_t phone, uint16_t phoneAlt, ChewingData *pgdata);
int CallPhrasing(ChewingData *pgdata, int all_phrasing);
int MakeOutputWithRtn(ChewingOutput *pgo, ChewingData *pgdata, int keystrokeRtn);
Expand Down
1 change: 1 addition & 0 deletions src/chewingio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,7 @@ CHEWING_API int chewing_handle_Default(ChewingContext *ctx, int key)
End_KeyDefault:
CallPhrasing(pgdata, 0);
End_Paging:
ResetOldChiSymbolCursor(pgdata);
MakeOutputWithRtn(pgo, pgdata, keystrokeRtn);
return 0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/chewingutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ int ReleaseChiSymbolBuf(ChewingData *pgdata, ChewingOutput *pgo)
return throwEnd;
}

/* Sync the oldChiSymbolCursor after choice */
void ResetOldChiSymbolCursor(ChewingData *pgdata)
{
pgdata->choiceInfo.oldChiSymbolCursor = pgdata->chiSymbolCursor;
}

static int ChewingIsBreakPoint(int cursor, ChewingData *pgdata)
{
static const char *const BREAK_WORD[] = {
Expand Down
4 changes: 4 additions & 0 deletions src/choice.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ int ChoiceNextAvail(ChewingData *pgdata)
return 0;
}

/* TODO:
** Distinguish in what situation the chiSymbolCursor should be
** reset to the oldChiSymbolCursor
*/
int ChoiceEndChoice(ChewingData *pgdata)
{
pgdata->bSelect = 0;
Expand Down