[TxMt] Problem with global search and replace: Replace in the wrong spots!

Alex Kessaris alex at artsy.ca
Mon Feb 13 02:07:31 UTC 2012


Hi All,

New to this list, sorry if this is a repost but I searched a couple of 
months back in the archives and can't find any mention of it.

I very often use global search and "replace all" in a project. When 
doing so, my replacement term doesn't go in the right place, but rather 
in random places in the file, sometimes close to the head of the file.

I can't pinpoint the exact place where it'll land, but it definitely 
doesn't go where it should.

Here is an example, sorry for the code dump!

Sincerely,

Alexandros

For example:

ORIGINAL FILE =======

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
     Replace me here
</body>
</html>


GLOBAL SEARCH AND REPLACE ======

search: Replace me here
Replace: I want a new body


EXPECTED OUTPUT =============

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
     I want a new body
</body>
</html>

ACTUAL OUTPUT =================

<!DI want a new body html> <!-- Replacement text is here! -->
<html>
<head>
<title>Page Title</title>
</head>
<body>
     Replace me here
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20120213/ba55f9b5/attachment.html>


More information about the textmate mailing list