Bug 409589

Summary: Text containing newline not prefilled using "Search/replace"
Product: [Applications] kate Reporter: Louis Tim Larsen <louis>
Component: searchAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: minor CC: christoph
Priority: NOR    
Version First Reported In: 19.04.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Louis Tim Larsen 2019-07-07 16:46:04 UTC
SUMMARY

When selecting a text in Kate containing a newline and choosing to replace the text string it is not prefilled in the "Find:" field whatever "Mode:" is set to "Plain text" or "Regular expression"


STEPS TO REPRODUCE

Selecting a text which includes a newline like:

Line1
Line2ADDITIONAL INFORMATION


- then selecting "Edit -> Replace"

OBSERVED RESULT

The text is not prefilled in the "Find:" field. This is true whatever "Mode:" is set to "Plain text" or "Regular expression"


EXPECTED RESULT

The text in the "Find:" field should be: Line1\nLine2 at least when "Mode:" is set to "Regular expression".


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version:  5.16.2
KDE Frameworks Version: 19.04.2
Qt Version: 5.13.0
Comment 1 Dominik Haumann 2019-07-08 21:31:39 UTC
Hm, I think this is by design. Two reasons:
1. When multiple lines are selected, the "selection only" option is automatically turned on.
2. Assume you select the entire document. You wouldn't want all the document content in one line edit.

To me, this looks like a functions-as-designed.

As workaround, I suggest to Ctrl+C before Ctrl+f, then you just need to Ctrl+v and you have what you want. ...I currently don't know whether newlines are converted into \n characters, though.

Any other thoughts?
Comment 2 Christoph Cullmann 2019-07-13 17:15:28 UTC
Yes, this is per design. I don't think changing this makes sense, sorry, then other users (like me) will be irritated that want to have the auto "selection only" search.