bugGNU nano - Bugs: bug #46361, Ctrl+J keeps the trailing space(s)


bug #46361: Ctrl+J keeps the trailing space(s)

Submitted by:  Federico Bruni <fedelibre>
Submitted on:  Mon 02 Nov 2015 07:32:31 AM UTC  
Severity:  3 - Normal Status:  Fixed
Assigned to:  Chris Allegretta <astyanax> Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

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


Fri 26 Feb 2016 09:14:47 AM UTC, comment #3:

There's no stepping done. :)

I will probably start using 'justifytrim' myself. Losing a double space now and then when rejustifying things, I can probably live with -- having those glaring red things (in my default syntax) at the end of lines gone will have more weight.

Benno Schulenberg <bens>
Project Administrator
Thu 25 Feb 2016 09:58:00 PM UTC, comment #2:

Not to step on Benno's very correct statement here (as we'd never make nano become incompatible with Pico by default), but I have been bitten by this particular circumstance editing repeatedly in the last couple months. I implemented this as an option for .nanorc only, called justifytrim. It went in with nano 2.5.3.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Mon 02 Nov 2015 08:35:38 AM UTC, comment #1:

Thanks for reporting. Yes, I agree that this looks ugly when trailing whitespace is highlighted. But...

Two things: 1) Pico does this too, and nano copies Pico as closely as possible. 2) If a line ends in more than one space, and we delete all of them, how then can nano restore these multiple spaces when the paragraph is modified afterward and then reflowed again with ^J?

So... we won't change this.

Of course it would be possible to add an option like --trim-trailing-whitespace, which would be useful almost always, but I haven't yet heard anyone else make this suggestion. And then the question arises: when should it trim? When the cursor leaves the line? Whenever the file is saved? ... Problems.

Benno Schulenberg <bens>
Project Administrator
Mon 02 Nov 2015 07:32:31 AM UTC, original submission:

I hit Ctrl+J to reflow the text (actual breaks, not wraps), but the space(s) before the word which goes to the next line is not deleted. I noticed this clearly thanks to 'git diff'.

I'm using Nano 2.4.2 from fedora 23.

Federico Bruni <fedelibre>


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

Attach Files:

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 astyanax (Posted a comment)
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by fedelibre (Submitted the item)

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

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-27 bens Open/ClosedOpen => Closed
    2016-02-25 astyanax StatusWont Fix => Fixed
        Assigned toNone => astyanax
    2015-11-02 bens StatusNone => Wont Fix

    Back to the top

    Powered by Savane 3.3