[TxMt] Block Indent

Gavin Kistner gavin at refinery.com
Wed Sep 7 04:47:52 UTC 2005


I never, ever use column selection or typing, so perhaps the  
following behavior is useful there.

Frequently I have a block of code I need to indent. Say my Ruby code  
looks like this:

class Foo
def bar
     puts "yay"
end
end

I lazily select parts of the lines I want, (because it's faster than  
being sure to select the entire line) represented by the | in the  
following showing the start and end of the selection:

class Foo
de|f bar
     puts "yay"
en|d
end

When I press cmd-], I expect:

class Foo
     def bar
         puts "yay"
     end
end

(which is what BBEdit gives me), but what I get is:

class Foo
de    f bar
         puts "yay"
     end
end

...where's the logic in that? If I have no text selected, but the  
carat is in the middle of the line, cmd-] shifts the whole line (as  
desired). I suggest that the 'break-the-line' method only occur if  
the selection is columnar - i.e. if the start column of later lines  
is the same as the start column of the first line.



More information about the textmate mailing list