[TxMt] TM freezes completely on search&replace in 6K-lines XML-File!

Tom Lazar lists at tomster.org
Tue Jan 17 09:18:31 UTC 2006


On Jan 17, 2006, at 1:10 AM, Paul McCann wrote:

> Would you believe "TextMate"?
>
> Text => Filter through command... => (Input: Document, Output:  
> Replace Selection)
>
> perl -pe 's/\n//g'
>
> Pretty much instant. Undo is also virtually instant, should you not  
> like what it's done to your document! While the "g" isn't strictly  
> necessary in this instance it is in general if you're wanting to  
> replace all occurrences.
>
> For more generic regex substitutions just throw your "Find" and  
> "Replace" regexes between the leaning matchsticks. For case  
> insensitive matching you can use
>
> perl -pe 's/\n//gi'
>
> instead. Not ideal, but infinitely faster than the builtin (for now).

thank you so much, paul! that was *exactly* what I needed to keep  
things moving over here! phew ;)

instinctively, i'd also say, that the bottleneck is somewhere inside  
the regex-engine, since the problem exists just as well, when I turn  
off all syntax coloring by chosing "text plain"

@allan: if this is really narrowed down to searching for \n in large  
files you might consider checking for that on submit of the search  
form and then utilize the perl command that paul suggested.

best regards,

tom



More information about the textmate mailing list