[TxMt] find/replace in column selection

Leo Brewin Leo.Brewin at sci.monash.edu.au
Thu Nov 9 06:45:13 UTC 2006

HI Allan,

That makes sense -- for that kind of data. But I was thinking about  
this in the context of code where the introduction of unexpected  
spaces will cause havoc.

Here are two lines from some program.


If I use column selection to select "Foo" from the first line and  
"Bar" from the second line then when I do a replace in selection of  
Bar with FooBar the result will be

    Name1:=ThisFoo   Bar;

And my compiler will have kittens over this one!. What I wanted was


Is there an easy way to do this?


ps. thanks for the prompt response! I'm very impressed!

On 09/11/2006, at 4:35 PM, Allan Odgaard wrote:

> On 9. Nov 2006, at 05:58, Leo Brewin wrote:
>> I've just started using TextMate and I'm very very impressed. I've  
>> noticed the following behaviour and I wonder if anybody could let  
>> me know if this is a "feature" or  a bug.
>> I make a column selection and I replace "foo" with "foobar". This  
>> increases the width of the column selection. Here is the problem  
>> -- any continuous text that passed through the column will now be  
>> broken and expanded with spaces. This is not what I would expect  
>> and it will seriously limit my use of find/replace in column  
>> selections.
>> Is this a bug? Or is it an operator error?
> It is the intended behavior -- but it isn’t straight forward what  
> the result should be.
> You do want to preserve the selection after the replacement -- so  
> if one of the rows grows beyond the initial selection, should that  
> just bleed outside it?
> And if you have column data like:
>    foo    bar
>    fud    jaz
> Select first column and replace (in that) foo with foobar, the  
> result will then be:
>    foobar    bar
>    fud       jaz
> I.e. the columns still align -- seems to be a nice property.
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

More information about the textmate mailing list