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>
By the way, this is the Textmate 2 beta!
Hey!
I tend to hit the "Find All" button (if you want to search in the document or project folder) before I hit "Replace All". That seems to work for me. If you just want to search/replace in a selection, use the Sigma button before "Replace All".
David.
On Mon, Feb 13, 2012 at 2:19 AM, Alex Kessaris alex@artsy.ca wrote:
By the way, this is the Textmate 2 beta!
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 13/02/2012, at 09.07, Alex Kessaris wrote:
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.
Is this TextMate 2? If so, your files MUST be UTF-8 and LF-delimited, otherwise folder search may get things wrong as it (presently) doesn’t go through the same encoding / line-feed checks as when opening the file.
Also, after doing the Find you MUST NOT edit the files without then doing a new Find (if you intend to do replacements).