bugGNU nano - Bugs: bug #57402, unlike Pico, nano allows...

 
 

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

bug #57402: unlike Pico, nano allows justifying tab-indented paragraphs

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 13 Dec 2019 10:44:14 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Thu 30 Jul 2020 07:12:35 AM UTC, comment #11: 

Released in nano-5.0.

Benno Schulenberg <bens>
Group administrator
Sat 27 Jun 2020 09:21:43 AM UTC, comment #10: 

Pushed to master, commit 712f68c6.  It adds the command-line option --bookstyle / -O, and nanorc-file option 'set bookstyle'.

Benno Schulenberg <bens>
Group administrator
Mon 22 Jun 2020 08:02:30 AM UTC, comment #9: 

Please see attached patch.

(file #49342)

Benno Schulenberg <bens>
Group administrator
Mon 22 Jun 2020 07:29:19 AM UTC, comment #8: 

Thanks very much for reporting.  Feedback is great.  :)

Okay, will fix.  By adding an option: -O / --bookstyle.

Benno Schulenberg <bens>
Group administrator
Mon 22 Jun 2020 04:41:59 AM UTC, comment #7: 

My wife has been a long-time user of Nano (was on 2.2.6) and just installed Kubuntu 20.04 on a new laptop, which came with Nano 4.8.x, and discovered that justification was not working as expected.

She's writing a novel, and uses tabs to indent the first lines of paragraphs. In older Nano, something like this:

[Tab] "Here's a short paragraph!", the character said!
[Tab] And then in the next paragraph, we discover a long string of text which needs word-wrapping.

Hitting [Ctrl]-[J] on either line results in this:

[Tab] "Here's a short paragraph!", the character said! And then in the
[Tab] next paragraph, we discover a long string of text which needs
[Tab] word-wrapping

Whereas in older Nano, doing [Ctrl-J] on the first line would have no effect (it is not too wide, and therefore doesn't require wrapping ... and surely should NOT be attached to the following paragraph), and the second line would wrap as expected (again, not attaching itself to the previous paragraph).  Like so:

[Tab] "Here's a short paragraph!", the character said!
[Tab] And then in the next paragraph, we discover a long string of
text which needs word-wrapping


For the moment, I've gone ahead and uninstalled the "nano" package, and downloaded, built, and installed 2.2.6 from source for her, so she can continue working without changing her editing process or learning new tools.  In the meantime, I spotted this bug (while trying to figure out whether the behavior could be modified), and decided to add my 2 cents, for your consideration.  Thanks!

Bill Kendrick <billkendrick>
Thu 14 May 2020 03:49:01 PM UTC, comment #6: 

See 'info nano intro', second paragraph, what the current goal of nano is.  It changed.

Also, as noted in comment #3, Pico has changed.  Pico 5.09 will justify a block of text of which all lines start with the same number of spaces.  Older Picos didn't do that.  So, which Pico should nano emulate?

And familiar?  Familiar to what?  Most users of nano have never used Pico.  And nano's justifying has only improved with recent versions.  I have not heard anyone complain.  Which either means that no one uses ^J, or people think the behavior is fine, or they can put up with it.  Why make it configurable when no one other than you is asking for it?  You have the patch, you can make nano behave the way you prefer.  Others don't seem to need it.

Benno Schulenberg <bens>
Group administrator
Thu 14 May 2020 03:07:43 PM UTC, comment #5: 

So... The goal is no longer to emulate Pico's behaviour and add missing functionality on top?

It's great that Nano improves, but shouldn't it feel familiar?

Why not let users set their preferences through .nanorc?


Seb <seb5903>
Thu 14 May 2020 01:21:18 PM UTC, comment #4: 

The change could be added behind an option (maybe -O, --oldstyle, or --bookstyle), but at the moment we have only two letters left (-O and -q), and one will be needed for the scroll bar...

So, unless people start clamoring for the old-style justifying (that is: treat any line with leading whitespace as the start of a new paragraph when autoindent is off), we'll let this be.

Benno Schulenberg <bens>
Group administrator
Tue 24 Dec 2019 09:56:52 AM UTC, comment #3: 

Well, things are not as clear-cut as they seemed.  Pico's behavior apparently changes from version to version too.  My Manjaro system has Pico 5.04, and it will see any indented line as the start of a new paragraph (whether indented with spaces or tabs), and when a line wraps, the wrapped part always has zero indentation.  My Xubuntu system has Pico 5.09, and that one can justify a piece of text of which each line is indented with the same amount of spaces (and it will retain that amount of spaces).

So... when wanting to make a patch to go back to the "old" behavior, to which behavior should nano go back?  I don't see why nano should make a difference between tabs and spaces (and 4.7 has made another step in this direction), so when making a patch, it should consider any indented line as the start of a new paragraph.  See attached patch.

(file #48114)

Benno Schulenberg <bens>
Group administrator
Tue 17 Dec 2019 08:20:52 AM UTC, comment #2: 

The "next bug" referred to in comment #1 is bug #57404.

Benno Schulenberg <bens>
Group administrator
Fri 13 Dec 2019 11:07:26 AM UTC, comment #1: 

When a paragraph of text is indented with tabs instead of spaces, then Pico will see each line as a separate paragraph when typing ^J, but nano will see it as a single paragraph.

For example, create a file 'words' with the following content:


        word word
        word word
        word word
        word word


where each indentation consists of a single tab instead of eight spaces.  Then run 'pico words', and type ^J four times.  See how no justification is performed.  Then run 'nano --ignore words' and type ^J.  See how all eight words are rewrapped into a single line.

I would think that nano's behavior is the preferrable one, but... see the next bug I am going to report.

(This discrepancy between Pico and nano was discovered during an email conversation with Sébastien Desreux.)

Benno Schulenberg <bens>
Group administrator
Fri 13 Dec 2019 10:44:14 AM UTC, original submission:  


Benno Schulenberg <bens>
Group administrator

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-30 bens Open/ClosedOpen Closed
    2020-06-27 bens StatusIn Progress Fixed
    2020-06-22 bens Attached File- Added 0001-options-add-O-bookstyle-to-make-leading-whitespace-m.patch, #49342
    2020-06-22 bens StatusWont Fix In Progress
        Assigned toNone bens
    2020-05-14 bens Severity3 - Normal 2 - Minor
        StatusReady For Test Wont Fix
        Carbon-Copy- Added -email is unavailable-
    2019-12-24 bens Attached File- Added 0001-wrapping-a-line-with-leading-whitespace-always-start.patch, #48114
        StatusNone Ready For Test
    2019-12-13 bens Summaryunlike Pico, nano treats tabs and spaces equally when justifying unlike Pico, nano allows justifying tab-indented paragraphs

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code