bug-ncurses
[Top][All Lists]
Advanced

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

Re: misplaced cursor when a double-width character is near the lower-rig


From: Thomas Dickey
Subject: Re: misplaced cursor when a double-width character is near the lower-right corner
Date: Sat, 30 Jan 2021 19:46:05 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Jan 30, 2021 at 02:09:57PM -0500, Thomas Dickey wrote:
> On Thu, Jan 28, 2021 at 07:36:23PM -0500, Thomas Dickey wrote:
> > On Thu, Jan 28, 2021 at 10:56:31AM +0100, Benno Schulenberg wrote:
> > > 
> > > Op 13-01-2021 om 12:28 schreef Benno Schulenberg:
> > > > 
> > > >     src/nano --ignorercfiles --nohelp
> > > > 
> > > > Then type ^W and paste "123ㄓ" (without the quotes) as the answer (or if
> > > > you prefer to type it: 123 M-V 003113), and type <Home>.  Now hold down
> > > > "x" until the cactus character is exactly three spaces before the right
> > > > edge.  See that the cursor is on the "1".  Now type "a".  The cursor is
> > > > still on the "1".  Now type "b".  Oh: the cursor has moved to the "2".
> > > > Now type "c".  Ouch: the screen has scrolled, the cactus character has
> > > > been pushed to the next row, the title bar has disappeared, the end of
> > > > the prompt bar has "ab1c123 ", and the cursor is below the c.
> > > 
> > > Can you reproduce this, Thomas?  Or am I seeing ghosts?
> 
> ncurses is supposed to be counting cells, but the second part of a double-cell
> character is always going to be a special case.
>  
> > I haven't gotten to it yet: generally I work on ncurses on Saturdays,
> > and this past weekend, investigating the pmake took up the available
> > time.
> > 
> > (at the moment I expect to investigate this one on this weekend)
> 
> I can reproduce this, and will see how to fix it (thanks)

I see two problems:

the first is simple and causing the wrapping (an off-by-one),
but fixing that shows a nuisance (the "c" in your example gets written
to the wrong column).  I'd call that a nuisance since it only affects
1-2 cells on the screen, and doesn't scroll up anymore.

All of this dates back to 2004-2005, so I guess not many people run into
the bug...

I'll apply the off-by-one fix and continue looking for a fix for the
nuisance :-)

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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