https://bugs.kde.org/show_bug.cgi?id=142598

Grósz Dániel <groszdaniel...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |groszdaniel...@gmail.com
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Grósz Dániel <groszdaniel...@gmail.com> ---
I don't know if this really has been fixed at some point, but it has the broken
(or at least unexpected) behavior again.

It also happens with other assertions: if e.g. you replace "(?<= )." with "",
it removes everything after the first space, rather than only the first
character after each space; likewise, if you replace "\b\w" with "", it removes
every word character, rather than just the first character of each word.

My guess as to why this happens is that in each replacement step, Kate first
preforms a replacement, then moves the cursor to the end of the replacement
text (which is empty in our examples), and then performs the next search
beginning from there.

Instead, when using Replace All, it should first find all instances to replace,
and then perform all the replacements. This is what other regex replacement
engines seem to do, such as those of sed and javascript (at least in effect; I
don't know how they are implemented). When using the Replace button, it should
probably take into account the result of previous replacement, but not the
current replacement, when finding the next occurrence of the search string.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to