Bug 451798 - Replace all with escape sequences broken
Summary: Replace all with escape sequences broken
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 21.12.3
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-22 16:33 UTC by Daniel Roschka
Modified: 2022-03-22 16:59 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 Daniel Roschka 2022-03-22 16:33:30 UTC
SUMMARY

Recently "Replace All" in the replace dialog broke in certain cases when using the "Escape sequence" mode and only replaces a subset of strings to replace. Clicking "Replace all" multiple times will continue replacing strings until the desired result is eventually reached.

STEPS TO REPRODUCE

1. Open an new document in Kate.
2. Add the following content to the document:

    1\n
    2\n
    3\n
    4\n

3. Open the search replace dialog (CTRL + R)
4. Ensure the search/replace mode is set to "Escape sequences"
5. Enter "\\n" into the "Find" input field and "\n" into the "Replace" input field
6. Click "Replace All"

OBSERVED RESULT

A toast stating "2 replacements made" and the following content in the document now:

    1
    
    2
    
    3\n
    4\n


EXPECTED RESULT

A toast stating "4 replacements made" and the following content in the document now:

    1
    
    2
    
    3
    
    4
    

SOFTWARE/OS VERSIONS

KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Comment 1 Waqar Ahmed 2022-03-22 16:59:58 UTC
was fixed in 5.91