bugGNU nano - Bugs: bug #56054, Alt+D shows a wrong line count

 
 

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

bug #56054: Alt+D shows a wrong line count

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 02 Apr 2019 12:07:51 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Wed 19 Jun 2019 06:28:29 AM UTC, comment #4: 

Released in nano-4.3.

Benno Schulenberg <bens>
Group administrator
Thu 30 May 2019 06:01:51 PM UTC, comment #3: 

(Another good thing is that it now matches what the status bar says upon opening a file and upon typing ^S.)

Benno Schulenberg <bens>
Group administrator
Thu 30 May 2019 05:53:57 PM UTC, comment #2: 

Yeah, I agree.  At first I thought it would affect the output of ^C too, but that is a different mechanism.

Fixed in git, commit 3a65c0d1.

Benno Schulenberg <bens>
Group administrator
Tue 02 Apr 2019 10:41:47 PM UTC, comment #1: 

It includes the empty line at end of file. Type a character without final newline enabled and it still displays 1 line. With final newline enabled it changes to 2 lines after typing a character.

I think it should only ignore the last line if empty, regardless of the final newline setting. wc will report one fewer lines for non-posix files, but nano should display what the user can "see".

Brand Huntsman <brand>
Tue 02 Apr 2019 12:07:51 PM UTC, original submission:  

To reproduce, run 'nano --ignore' and type M-D.  It says:

  [ Words: 0  Lines: 1  Chars: 0 ]

This is wrong.  There is zero text there and no newline character; according to POSIX and to 'wc', the file consists of zero lines.

Expected behavior: M-D should give the same answer as 'wc'.

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 brand (Posted a comment)
  • -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
    2019-06-19 bens Open/ClosedOpen Closed
    2019-05-30 bens StatusNone Fixed
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code