bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] READLINE_POINT with multibyte locales


From: Chet Ramey
Subject: Re: [PATCH] READLINE_POINT with multibyte locales
Date: Mon, 9 Apr 2018 11:26:40 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 4/9/18 10:51 AM, Koichi Murase wrote:

> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
> 
> Description:
> 
>   Currently `READLINE_POINT' counts the number of bytes but not
> characters. This makes difficult to properly implement shell functions
> for `bind -x' that uses `READLINE_POINT'. In fact, almost all the
> implementations of `bind -x' functions which can be found in the
> internet is broken for this point.

Because the underlying readline variable that it controls, rl_point, is
kept in bytes -- an index into the line buffer. If you change this, it
will set the point to the wrong place in the buffer (exposed to that
function as READLINE_LINE).

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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