bugGNU nano - Bugs: bug #57804, typing an accented letter after...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57804: typing an accented letter after M-V gets the character count wrong

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 13 Feb 2020 11:28:28 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 13 Feb 2020 12:37:29 PM UTC, comment #2: 

Fixed in git, commit 9d232cd8.

Benno Schulenberg <bens>
Group administrator
Thu 13 Feb 2020 11:47:18 AM UTC, comment #1: 

Bug exists since version 2.6.3.  The offending commit is 08c51cfd: "ingest as verbatim just one control code or one or two escapes".

Benno Schulenberg <bens>
Group administrator
Thu 13 Feb 2020 11:28:28 AM UTC, original submission:  

To reproduce, run:

src/nano --ignore --constant

Then type: á.  See that the character is 2: one for the á, and one for the automatic newline.  Then type <Backspace> and <Delete> to remove those two characters, and see that the character count is 0 again.  Now type: M-V á.  See that the character count is 3.  Oops.

What happens is that the verbatim input takes only the first byte of the multibye á, injects it into the buffer (which increases the character count, even though it is seen as an invalid character), and then the next run of the input routine gets the remaining byte of the á and injects it into the buffer (this byte by itself is also invalid, and gets counter as another character).

What probably should be done is: when the verbatim input routine returns just one byte, and it is a starter byte of a Unicode multibyte character, then this byte should be put back into the keyboard buffer, so that the complete sequence will be taken from it in one go and the bytes will be seen as a single character.

(The problem probably originates from some years ago when I switched verbatim input away from eating up everything in the keyboard buffer verbatim, and switched it to eating only the first one or two bytes.)

Benno Schulenberg <bens>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-02-13 bens StatusIn Progress Fixed
    2020-02-13 bens StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code