diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-04-21 06:27:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-04-21 06:28:52 -0400 |
commit | 15483ac9df346b4ff59bb5286ba2598b729b88f1 (patch) | |
tree | 47b5bbbccd45db1046f1fd3c368ee493adc87163 | |
parent | 435ed3158cff7b9967aae2a33f52aab0d23720f6 (diff) | |
download | gtk+-im-cursor-pos.tar.gz |
imcontext: Fix cursor positionsim-cursor-pos
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.
Fixed: #3885
-rw-r--r-- | gtk/gtkimcontextsimple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index a3a2c54c8f..074ffdd01f 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -1152,7 +1152,7 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context, } if (cursor_pos) - *cursor_pos = s->len; + *cursor_pos = g_utf8_strlen (s->str, s->len); if (attrs) { |