Bug 449461

Summary: Search and replace does nothing
Product: [Applications] kate Reporter: php4fan
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: waqar.17a
Priority: NOR    
Version First Reported In: 21.12.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description php4fan 2022-02-01 16:31:43 UTC
STEPS TO REPRODUCE
1.  In a new file, type this:
aaa foo bar
lorem aaa ipsum
2.  Go to Search and Replace
3. Choose "in current file"
4.  Fill in to search for "aaa" and replace with "xxx"
5. Click on "Search". Found matches will show up below and will be already checked
6. Click "Replace Checked" or "Replace".

OBSERVED RESULT
When I click on "replace checked" nothing happens.
When I click on "Replace", nothing gets replaced, and Kate switches to another tab. Complete madness.

EXPECTED RESULT
With "Replace checked" it should replace the checked matches, which are all of them because I haven't unchecked any.
With Replace it's not clear (and that's a design flaw) whether it's supposed to replace one next occurrence or all occurrences (usually, normal editors with decent search&replace interfaces have two buttons, "replace" (one) and "replace all").


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Waqar Ahmed 2022-02-01 20:40:02 UTC
This has been fixed in master.

It fails because we were using URLs to do everything, but unsaved newly created files have no URLs so search didn't work there.