Sublime Forum

Bug: S&R Substitutes Previous Matches

#1

ST3 x64 build 3154 for Win10

I think it’s a bug.

When carrying out Find-And-Replace (RegEx) within a document, and having skipped some matches via F3, when I choose Replace on current match ST actually replaces previous skipped match.

I’ve tried to exit the F&R bar, disable RegEx, and renable it again, and start again Search from top of doc, but the problem persists.

If this might me of any help, this is part of the source doc on which the problem occured:

  Escape=[=[ \\[ntvbrfa\\\?'"]|\\\d{3}|\\x[[:xdigit:]]{2} ]=],
--[[------------------------------------------------------------------------------
                                  INTERPOLATION                                 
    ------------------------------------------------------------------------------
    String, regex of interpolation sequences (optional)
--]]
  Interpolation=[[ %[%#0\-\+diouxXeEfFgGcrs]+|%\(\w+\)[sd]?|\{\w+\} ]] -- ???
}

--[[==============================================================================
                                      OPERATORS                                   
    ==============================================================================
--]]
Operators=[[\&|<|>|\!|\||\=|\/|\*|\%|\+|\-|~]] --

the Find RegEx: (?<!-)(\[|\])\1
the Replace str: \1=\1

Basically, I’m trying to skip the Escape=[=[ line, and Replace matches from the Interpolation=[[ line, but even if the match is on the latter, replacing is carried out on the former (skipped matches) — ST keeps movingthe caret on |\\x[[:xdigit:]] instead of replacing, for some reason.

0 Likes

#2

this has also been reported here:

0 Likes