bugGNU nano - Bugs: bug #57342, [Request] mention that the command...

 
 

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

bug #57342: [Request] mention that the command line allows negative numbers after +

Submitted by:  Andreas Schamanek <aschamanek>
Submitted on:  Mon 02 Dec 2019 09:18:43 AM UTC
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

( Jump to the original submission )

Tue 24 Dec 2019 09:12:14 AM UTC, comment #6: 

Released in 4.7.

Benno Schulenberg <bens>
Project Administrator
Mon 02 Dec 2019 04:14:12 PM UTC, comment #5: 

Thanks for confirmimg.  Patch has been applied and pushed: commit 076eb6f6 -- https://git.savannah.gnu.org/cgit/nano.git/commit/?id=076eb6f6 .

Benno Schulenberg <bens>
Project Administrator
Mon 02 Dec 2019 03:30:13 PM UTC, comment #4: 

Great! I think that's a worthwhile addition. Thanks a lot!

Andreas Schamanek <aschamanek>
Mon 02 Dec 2019 10:27:49 AM UTC, comment #3: 

How about the attached patch?

(file #47965)

Benno Schulenberg <bens>
Project Administrator
Mon 02 Dec 2019 10:03:48 AM UTC, comment #2: 

Ooops, sorry for the noise. I did read the current manpage, and I even tried +-line, but I tried it with an older nano.

So, maybe the support of negative numbers could be mentioned in the manpage?

Andreas Schamanek <aschamanek>
Mon 02 Dec 2019 09:49:52 AM UTC, comment #1: 

Nano already supports negative line numbers on the command line (since version 2.8.5):

  nano  +-1  filename

to start at the bottom of the file.  (The "+-" may be a bit unintuitive, but it works fine.)

Benno Schulenberg <bens>
Project Administrator
Mon 02 Dec 2019 09:18:43 AM UTC, original submission:  

I find myself quite regularly editing files where I need to edit the last line or add a line at the end of the buffer/file. Nano offers keyboard shortcuts to jump to the end, but I was wondering whether it might be possible to support negative numbers on the command line like it is already the case for the "Go To Line" command (cf. bug #48248).

What I currently use to edit the last line is

nano +$(wc -l $file)

To add a line at the end

nano +$(($(wc -l <$file)+1)) $file

Andreas Schamanek <aschamanek>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by aschamanek (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.

    Only logged-in users can vote.

     

     

     

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-24 bens Open/ClosedOpen => Closed
    2019-12-02 bens Assigned toNone => bens
    2019-12-02 bens Severity1 - Wish => 2 - Minor
        StatusIn Progress => Fixed
    2019-12-02 bens Attached File- => Added mention-negative-numbers.patch, #47965
        StatusWorks For Me => In Progress
        Summary[Request] Negative numbers in CLI's +line arg (e.g. to jump to last line) => [Request] mention that the command line allows negative numbers after +
    2019-12-02 bens Severity3 - Normal => 1 - Wish
        StatusNone => Works For Me

    Back to the top


    Powered by Savane 3.9