diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2022-01-06 11:20:26 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2022-01-06 11:20:26 +0900 |
commit | f5757ada54edaa7d2e3ea948d340cdf48064e30c (patch) | |
tree | 95f6af18ceaf0d3a7d8354be86e929731dd3cbed | |
parent | 675b94f63a2bce5554c9bb28a03462ed70933bec (diff) | |
download | ibus-f5757ada54edaa7d2e3ea948d340cdf48064e30c.tar.gz |
ibusenginesimple: Fix to send char position at update_preedit_text
ibus_engine_update_preedit_text() should send the character position
instead of the byte position.
BUG=https://github.com/ibus/ibus/issues/2368
-rw-r--r-- | src/ibusenginesimple.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c index 83b04ebc..a80e41a5 100644 --- a/src/ibusenginesimple.c +++ b/src/ibusenginesimple.c @@ -2,7 +2,7 @@ /* vim:set et sts=4: */ /* ibus - The Input Bus * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com> - * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com> + * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com> * Copyright (C) 2014-2017 Red Hat, Inc. * * This library is free software; you can redistribute it and/or @@ -386,7 +386,7 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple) } else if (s->len >= G_MAXINT) { g_warning ("%s is too long compose length: %lu", s->str, s->len); } else { - int len = (int)s->len; + guint len = (guint)g_utf8_strlen (s->str, -1); IBusText *text = ibus_text_new_from_string (s->str); ibus_text_append_attribute (text, IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len); |