SUMMARY Since a few months ago, when I press F7 to open the command line in Kate and try to use a regular expression like: %s/foo/bar/ it shows the error: Command "%s/foo/bar/" failed. If I type: s/foo/bar/ it works—but only on the line where the cursor is. Does anyone know what's going on? I'm using Arch Linux. I also installed the Flatpak version of Kate (following the link from the official website), and the same behavior happens there. Regards. STEPS TO REPRODUCE 1. Open Kate. 2. Write some lines of text. 3. Press F7 to open the command line. 4. Type %s /foo/bar (or %s/foo/bar/) OBSERVED RESULT I get: Command "%s /foo/bar/" failed. EXPECTED RESULT It should replace foo for bar in all the lines. SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: Arch Linux KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.13.0 Qt Version: 6.9.0 ADDITIONAL INFORMATION
CommandRangeExpressionParser::parseRangeExpression seems to not properly parse that, it doesn't enter the if (match.hasMatch() && match.capturedLength(0) > 0) { commandTmp.remove(m_cmdRangeRegex); code path at all.
(In reply to Christoph Cullmann from comment #1) > CommandRangeExpressionParser::parseRangeExpression seems to not properly > parse that, it doesn't enter the > > if (match.hasMatch() && match.capturedLength(0) > 0) { > commandTmp.remove(m_cmdRangeRegex); > > code path at all. Hi, so, is something gonna happend with this? Any idea? Regards.
(In reply to vassari from comment #2) > (In reply to Christoph Cullmann from comment #1) > > CommandRangeExpressionParser::parseRangeExpression seems to not properly > > parse that, it doesn't enter the > > > > if (match.hasMatch() && match.capturedLength(0) > 0) { > > commandTmp.remove(m_cmdRangeRegex); > > > > code path at all. > > Hi, > > so, is something gonna happend with this? > > Any idea? > > Regards. Beside tracing it down to that location, I had no time to fix that. If somebody else has time to look at that in more detail, help is welcome.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/814
Git commit 6b88616baf6b66c941d9f4ef84f6277da07519df by Waqar Ahmed. Committed on 01/06/2025 at 09:42. Pushed by cullmann into branch 'master'. Fix m_marks not initialized This got lost during refactorings years ago The bigger problem here is that we have 2 copies of this class, one in ViMode and this one. The ViMode one seems to be the maintained variant so we should drop this class soon and use the same class everywhere. M +22 -0 autotests/src/kateview_test.cpp M +1 -0 autotests/src/kateview_test.h M +1 -0 src/utils/katecommandrangeexpressionparser.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/6b88616baf6b66c941d9f4ef84f6277da07519df