Bug 409589 - Text containing newline not prefilled using "Search/replace"
Summary: Text containing newline not prefilled using "Search/replace"
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: search (other bugs)
Version First Reported In: 19.04.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-07 16:46 UTC by Louis Tim Larsen
Modified: 2019-07-13 17:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.