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

 
 

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

Submitted by:  None
Submitted on:  Wed 03 Feb 2016 12:16:09 PM UTC  
 
Severity: 1 - WishStatus: Wont Fix
Assigned to: NoneOpen/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project 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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 24 Feb 2017 11:37:19 AM UTCbensOpen/ClosedOpen=>Closed
    Thu 04 Feb 2016 11:09:28 AM UTCbensSeverity3 - 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.1-cleanup1