* Re: master e91848344e: Pass through caret position from native GTK
@ 2022-01-09 17:07 Eli Zaretskii
2022-01-10 0:27 ` Po Lu
0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2022-01-09 17:07 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> --- a/src/gtkutil.c
> +++ b/src/gtkutil.c
> @@ -6089,6 +6089,13 @@ xg_im_context_preedit_changed (GtkIMContext *imc, gpointer user_data)
> EVENT_INIT (inev);
> inev.kind = PREEDIT_TEXT_EVENT;
> inev.arg = build_string_from_utf8 (str);
> +
> + Fput_text_property (make_fixnum (min (SCHARS (inev.arg), <<<<<<<<<<<<
> + max (0, cursor))),
> + make_fixnum (min (SCHARS (inev.arg),
> + max (0, cursor) + 1)),
> + Qcursor, Qt, inev.arg);
Is it really correct to use SCHARS in the first argument to
Fput_text_property? It should be SCHARS(..)-1, I think, as the
characters in a string are indexed zero-based.
(There are several places in this commit where I spotted the same
code.)
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-10 0:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-09 17:07 master e91848344e: Pass through caret position from native GTK Eli Zaretskii
2022-01-10 0:27 ` Po Lu
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.