Open haraldschilly opened 7 years ago
There is also another problem: in a file where somewhere is /tmp/cocalc
, and searching for /tmp/cocalc
, only gives tmp
. Maybe it automatically translates this into a regex? Oh yes, it does! So, maybe that should be an optional flag...
Oh yes, it does! So, maybe that should be an optional flag...
This is not our code; it's an upstream CodeMirror plugin -- https://codemirror.net/5/demo/search.html
WORKAROUNDS:
Personally, I use Sublime bindings and (1) do a search, then (2) duplicate the cursor to all matches I want, and (3) use multiple cursors to do replace... I never ever use global automatic search/replace -- I just don't trust it; I want to see every spot where the search/replace will happen.
If I am doing a genuinely global search/replace, I use sed in the terminal, sometimes with the assistance of AI. I then use git to see exactly what changed to make sure it is correct...
The issue is motivated by search+replace of
\latexcommand
in latex code, but it is in general about any backslashes in search strings when used for replacing text. The core issue seems to be that at some point an escaped backslash is getting removed. Steps to reproduce:*.md
document something like:test \foo foo
test foo \foo baz