bugGNU nano - Bugs: bug #50737, with softwrap, dynamic home can...

 
 

bug #50737: with softwrap, dynamic home can misplace the cursor on two-column characters

Submitted by:  David Lawrence Ramsey <dolorous>
Submitted on:  Wed 05 Apr 2017 09:52:16 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 09 Apr 2017 05:28:25 PM UTC, comment #6:

No problem.

As for smart home, good to know, but you're probably right about its being too late to change: it's worked that way since it was added back in 2004, and KWrite and juffed's equivalents of smart home work that way as well. If it was changed now, unfortunately, we'd probably get a bunch of complaints of "why do I now have to hit Home twice to make it move to the first non-blank character instead of once?"

David Lawrence Ramsey <dolorous>
Project Administrator
Sun 09 Apr 2017 10:06:46 AM UTC, comment #5:

Fixed in git, 9f2c80db.

(I don't know why the extra condition in do_end() was needed -- it seems to work fine without it too. So I've stripped it from the patch.)

Thanks for testing.

All this playing with Home and End has made me realize that I don't like how smarthome works: I think <Home> should first of all move toward the left: when /in the middle of leading whitespace/ and smarthome is in effect, currently a <Home> will move toward the right, to the first non-blank character. My expectation is that it should move left, fully home, and /only/ if already there, then to the first non-blank character. But it's probably too late to change this behavior now.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 08 Apr 2017 02:42:02 PM UTC, comment #4:

That works well too.

David Lawrence Ramsey <dolorous>
Project Administrator
Fri 07 Apr 2017 09:36:26 AM UTC, comment #3:

Here is an improved patch, which also makes <End> work properly after a <Home> has put the cursor on the second half of a character.

(file #40305)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 06 Apr 2017 11:07:48 PM UTC, comment #2:

It seems to work well so far.

David Lawrence Ramsey <dolorous>
Project Administrator
Thu 06 Apr 2017 07:49:32 PM UTC, comment #1:

Here's a first, rough patch.

(file #40300)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 05 Apr 2017 09:52:16 PM UTC, original submission:

With current git, dynamic home sometimes doesn't work as expected when two-column characters are straddling the screen edge. (Dynamic end uses similar logic to dynamic home, but doesn't seem to have any problems as far as I can tell. Still, it may need to be double-checked.)

This bug assumes that you're running current git with one of the patches from bug #50687 applied, as it improves movement when dealing with two-column characters and makes the problem easier to reproduce. There are two variants of the problem:

Variant 1:

1. Load the attached file with the following:

nano --ignore --softwrap chinese.html

2. Press Down four times, and then Right once. This will place the cursor on the character after the right half of a character straddling the screen edge.

3. Press Home. The cursor will move to the left half of the character straddling the screen edge at the end of the previous row, instead of to the right half at the beginning of the current row (since normally nano can't place the cursor on the right half of a two-column character).

Variant 2:

1. Load the attached file with the following:

nano --ignore --softwrap chinese.html

2. Press Down four times. This will place the cursor on the right half of a character straddling the screen edge.

3. Press Home. The cursor will move to the beginning of the previous row, instead of moving to the beginning of the actual line since it started at the beginning of the current row (since normally nano can't place the cursor on the right half of a two-column character).

David Lawrence Ramsey <dolorous>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40300:  do-visual-home.patch added by bens (907B - text/x-diff)
file #40274:  chinese.html added by dolorous (916B - text/html)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Updated the item)
  • -unavailable- added by dolorous (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 09 Apr 2017 10:06:46 AM UTCbensStatusIn Progress=>Fixed
      Assigned toNone=>bens
      Open/ClosedOpen=>Closed
      Summarywith softwrap, dynamic home can misplace the cursor on 2-column characters=>with softwrap, dynamic home can misplace the cursor on two-column characters
    Fri 07 Apr 2017 09:36:26 AM UTCbensAttached File-=>Added 0001-moving-when-determining-where-we-are-on-the-screen-u.patch, #40305
    Thu 06 Apr 2017 07:49:32 PM UTCbensAttached File-=>Added do-visual-home.patch, #40300
      StatusNone=>In Progress
    Wed 05 Apr 2017 09:52:16 PM UTCdolorousAttached File-=>Added chinese.html, #40274

    Back to the top


    Powered by Savane 3.1-cleanup1