Hi Lucas,

On Thu, Apr 03, 2025 at 05:17:35PM +0000, Lucas Gabriel Vuotto wrote:
> Hey Walter,
> 
> Thanks for the report.
> 
> On Thu, Apr 03, 2025 at 02:55:11PM +0200, Walter Alejandro Iglesias wrote:
> > Using vi mode in ksh I noticed that the command endword (vi.c) gets
> > staked when the last character in a word is a UTF-8 character.
> > 
> > To reproduce:
> > 
> > In the line bellow, using vi mode, first move your cursor to the first
> > character, then hit "e" several times.  You'll see the cursor get
> > stacked in the euro sign.
> > 
> >   $ word word€ word
> >              ^ this is an euro sign.
> 
> It also happens with E command.
> 
> > The following diff is one of my intuitive C newbie solutions, some
> > expert will surely find a better one.
> 
> The patch isn't correct: you're calling isspace (expects a character)
> with the result of isu8cont (which is a boolean).

I didn't pay attention. :-)

> 
> The right places to fix this seem to be endword and Endword. The patch
> below fixes the issue for me.

Your patch works for me too, thanks!

> The approach taken is first skipping all
> the UTF-8 continuation bytes after the cursor, before considering
> skipping spaces.
> 
> OK? Too close for release?
> 
>       Lucas
> 
> 

-- 
Walter

Reply via email to