bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] rl_point, multibyte strings, and the cursor position


From: Ulf Magnusson
Subject: Re: [Bug-readline] rl_point, multibyte strings, and the cursor position
Date: Mon, 16 Feb 2015 16:26:54 +0100

Okay, I'll roll my own then.

Thanks,
Ulf

On Mon, Feb 16, 2015 at 4:06 PM, Chet Ramey <address@hidden> wrote:
On 2/16/15 9:30 AM, Ulf Magnusson wrote:
> Hello,
>
> I'm combining readline and ncurses in the same program. I'm using a custom
> rl_redisplay_function that prints rl_line_buffer ("mvprintw(x, y,
> rl_line_buffer)") and moves the cursor to rl_point ("move(y, rl_point)").
>
> Since rl_point is a byte rather than character offset, this breaks for
> strings with multibyte characters (as well as for other cases like
> combining characters). It would be handy if readline exported its idea of
> where the cursor should be (e.g., rl_cursor_col) to avoid code duplication.
> Thoughts?

Readline doesn't maintain that information; it computes it as part of
redisplay.  It's one of the things that a custom redisplay function has
to take care of.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/


reply via email to

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