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

Re: Some groundwork for Unicode in Zle



Clint Adams wrote:
> > Trapping and converting all direct or indirect uses of zlecs (cursor
> > position) and zlell (line length) outside the core zle code to use the
> > correct position with a multibyte string is likely to be a nightmare.
> 
> I wonder if moving the zlecs-/zlell-using functions from Src/hist.c and
> Src/lex.c to Src/Zle would be a good idea, since they seem to be
> operating directly on the input buffer.

That's a long term goal.  I'd like to have separate variables within the
main shell (and probably the completion system, though that's murkier)
so that zlecs and zlell are only ever used when referring directly to
zleline.  The idea is that when converting the line to a multibyte
string we also convert the character positions to refer to the position
in that rather than the original wide character array.

For now, the problem is that if we move them into zle, we need hooks to
get at them from the main shell when appropriate.  That's not worth
doing if they're going to disappear from the main shell eventually.

I had a brief go at replacing zlecs and zlell when used for completion
and it blew up.  I think the difficulties were actually in the
completion functions that set up and use the lexical analyser, however.
It wasn't clear when to convert and when to restore.  Any help there
would be appreciated.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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