Hi Folks,
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?
Thanks, Leo
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.
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.
Name1:=ThisFooBar; Name2:=ThatBar;
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; Name2:=ThatFooBar;
And my compiler will have kittens over this one!. What I wanted was
Name1:=ThisFooBar; Name2:=ThatFooBar;
Is there an easy way to do this?
Cheers Leo
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@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 9. Nov 2006, at 07:45, Leo Brewin wrote:
[...] Here are two lines from some program.
Name1:=ThisFooBar; Name2:=ThatBar;
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; Name2:=ThatFooBar;
I see that it doesn’t work here -- but I wonder, is this an actual example of what you’re doing? Seems to be not the most intuitive use of replacements performed in columns ;)
Hi Allan,
Yes, I do this kind of thing often enough to make it useful (for me). Maybe other people have ways of achieving the same result. I came to TextMate after working with nedit for many years. Its search and replace in a column selection is exactly how I have described it here. IMHO, I think a search replace should only ever change the text that matches the search query (regardless of how the search/replace was applied -- replace all, replace in selection or even replace in a column selection). I don't feel comfortable with commands that have unknown side-effects. Its really only a minor quibble and I'm certainly very happy with TextMate...but if you do add extra functionality to the search/replace I'd be even happier!
Cheers, Leo
On 10/11/2006, at 1:10 AM, Allan Odgaard wrote:
On 9. Nov 2006, at 07:45, Leo Brewin wrote:
[...] Here are two lines from some program.
Name1:=ThisFooBar; Name2:=ThatBar;
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; Name2:=ThatFooBar;
I see that it doesn’t work here -- but I wonder, is this an actual example of what you’re doing? Seems to be not the most intuitive use of replacements performed in columns ;)
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate