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

Re: PATCH: handle multibyte chars in compset -p/-s

On Mon, 09 Oct 2017 11:42:20 +0200
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> On 7 Oct, I wrote:
> > Incidentally, while pondering such a solution, I noticed that
> > compset -p is removing bytes rather than characters to IPREFIX which
> > would have been useful in this case but should be corrected.
> Having further checked uses of compset -p, I'm satisfied that compset -p
> and -s should be handling multibyte characters so this is a patch to do
> that. Is mb_metacharlenconv and backwardmetafiedchar as used here the
> best way to do that?

Probably --- it certainly doesn't look any more clumsy than the rest of
the multibyte handling.  Going backwards is a pain so closing your eyes
and calling the function is probably correct, and going forward that
family of function calls are much more efficient.

(BTW the real horror for multibyte characters in completion is matching
control --- it's tied to single-character array handling and at a point
where conversion from and to wide characters isn't particularly
convenient.  I gave up on this after looking for some weeks about a
decade ago.)


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