emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master e91848344e: Pass through caret position from native GTK


From: Eli Zaretskii
Subject: Re: master e91848344e: Pass through caret position from native GTK
Date: Sun, 09 Jan 2022 19:07:52 +0200

> --- 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]