bugGNU nano - Bugs: bug #47053, [Request] allow newlines (LF) in...

 
 

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

bug #47053: [Request] allow newlines (LF) in 'Replace with:'

Submitter:  None
Submitted:  Wed 03 Feb 2016 12:16:09 PM UTC
   
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Thu 04 Feb 2016 11:09:28 AM UTC, comment #1: 

Internally, nano stores each line of a buffer in a separate container.  Which means that:

1) Regular expressions can only work within one line; they can never span multiple lines.

2) Replacements cannot split up a line.

The latter thing would in theory be possible to make, but it is a huge effort -- first to allow a ^J to be entered as part of the string, and then special casing a replacement that contains a ^J, not to speak of one that contains multiple ^Js.

So I'm marking this as too-hard-to-fix, cantfix, wontfix.

Benno Schulenberg <bens>
Group administrator
Wed 03 Feb 2016 12:16:09 PM UTC, original submission:  

With the help of meta-V it is possible to input many control characters in the replacement string. However the most useful of control characters is the Unix newline or ^J or LF which seems to be impossible to use in the replacement target (http://stackoverflow.com/questions/25959610/nano-insert-newline-in-search-and-replace)

In nano 2.4.2, enter gets mapped to ^M (CR) on my Linux; pressing meta-V ctrl-J does not work either - instead of inserting ^J to the replacement, the search-replace is commenced immediately.

The expected behaviour would be that using meta-V with ctrl-J should result in ^J, ctrl-M should result in ^M and if possible, enter should result in the correct newline format, whichever, to be inserted in the replacement string.

Anonymous

 

(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 (Posted a comment)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-24 bens Open/ClosedOpen Closed
    2016-02-04 bens Severity3 - Normal 1 - Wish
        StatusNone Wont Fix
        SummaryAllow newlines (LF) in `Replace with:` [Request] allow newlines (LF) in 'Replace with:'

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code