Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: src/IBusChewingEngine.gob

Issue 6312141: When decorating the preedit string, stop forcing the cursor past the end of the input (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/ibus-chewing.git@master
Patch Set: rebase Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 requires 2.0.0 1 requires 2.0.0
2 2
3 %alltop{ 3 %alltop{
4 /* 4 /*
5 * Copyright © 2009 Red Hat, Inc. All rights reserved. 5 * Copyright © 2009 Red Hat, Inc. All rights reserved.
6 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com> 6 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com>
7 * 7 *
8 * This file is part of the ibus-chewing Project. 8 * This file is part of the ibus-chewing Project.
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 gint cursorRight=0; 503 gint cursorRight=0;
504 gint charLen=(gint) g_utf8_strlen(iText->text, -1); 504 gint charLen=(gint) g_utf8_strlen(iText->text, -1);
505 switch(self->inputMode){ 505 switch(self->inputMode){
506 case CHEWING_INPUT_MODE_SELECTING: 506 case CHEWING_INPUT_MODE_SELECTING:
507 cursorRight=*chiSymbolCursor + MAX(zhuyin_item_written, 1); 507 cursorRight=*chiSymbolCursor + MAX(zhuyin_item_written, 1);
508 break; 508 break;
509 case CHEWING_INPUT_MODE_EDITING: 509 case CHEWING_INPUT_MODE_EDITING:
510 case CHEWING_INPUT_MODE_SELECTING_DONE: 510 case CHEWING_INPUT_MODE_SELECTING_DONE:
511 default: /* BYPASS */ 511 default: /* BYPASS */
512 » » cursorRight=*chiSymbolCursor + MAX(zhuyin_item_written, 1); 512 » » cursorRight=*chiSymbolCursor + zhuyin_item_written;
513 break; 513 break;
514 } 514 }
515 515
516 G_DEBUG_MSG(5,"[I5] decorate_preedit() charLen=%d cursorRight=%d", char Len, cursorRight); 516 G_DEBUG_MSG(5,"[I5] decorate_preedit() charLen=%d cursorRight=%d", char Len, cursorRight);
517 if (*chiSymbolCursor< cursorRight){ 517 if (*chiSymbolCursor< cursorRight){
518 ibus_text_append_attribute (iText, IBUS_ATTR_TYPE_FOREGROUND, 0x00ff ffff, 518 ibus_text_append_attribute (iText, IBUS_ATTR_TYPE_FOREGROUND, 0x00ff ffff,
519 *chiSymbolCursor, cursorRight); 519 *chiSymbolCursor, cursorRight);
520 ibus_text_append_attribute (iText, IBUS_ATTR_TYPE_BACKGROUND, 0x0000 0000, 520 ibus_text_append_attribute (iText, IBUS_ATTR_TYPE_BACKGROUND, 0x0000 0000,
521 *chiSymbolCursor, cursorRight); 521 *chiSymbolCursor, cursorRight);
522 } 522 }
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 IBusProperty *prop=self_get_iBusProperty(self, prop_name); 1114 IBusProperty *prop=self_get_iBusProperty(self, prop_name);
1115 ibus_property_set_visible(prop,FALSE); 1115 ibus_property_set_visible(prop,FALSE);
1116 ibus_engine_update_property(engine,prop); 1116 ibus_engine_update_property(engine,prop);
1117 } 1117 }
1118 } 1118 }
1119 1119
1120 %{ 1120 %{
1121 #include "IBusChewingEngine-keys.c" 1121 #include "IBusChewingEngine-keys.c"
1122 %} 1122 %}
1123 1123
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698