Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] fix mulibyte input/mbstate_t problem



On Wednesday 23 February 2005 13:51, Peter Stephenson wrote:
> We do probably need to reset the shift state each time zleread() is
> called to get a complete line, however, so the static in getrestchar()
> probably needs to be a global somewhere.
>

Yes, I intend make getrestchar to accept mbstate as parameter at some point.

> Presumably also leaving the mbrtowc in stringaszleline separate, as it
> is at the moment, is also the right thing to do.
>
> > Editing Russian is funny; "echo xxxx" outputs correct text but during
> > line editing display is wrong (it counts every UTF-8 as 2 screen
> > characters).
>
> If it works otherwise, e.g. the cursor moves over the right number of
> characters (but not screen columns), I guess that's something in
> zle_refresh.c.  We're not using wcwidth, yet, but it doesn't sound like
> that's the problem since it should assume a single column per character.
>

I am rewriting it to use wide char. the problem was that cursor position was 
assumed equal to string position which was wrong for multibyte characters. 
Having refresh to deal consistently with wide chars simplifies everthing a 
lot.

it still does not wcwidth, currently everything is assumed to be exactly 1 
char.



Messages sorted by: Reverse Date, Date, Thread, Author