[TxMt] Re: shift-right and caret position question

saiwingy saiwing at berkeley.edu
Tue Mar 1 19:01:19 UTC 2011


I guess I will try to write a macro. I have been using TextMate for over 2
years and didn't notice it until recently. But once I saw it, I really do
want it to behave differently.

Actually I just tried it with soft tabs and it is similar. I would argue
that it is kind of harder to imagine why this would be useful in soft tabs
(more so than the non-soft tabs case). For example, here I set TextMate to
soft tabs: 4

soft tab testing<caret>

command-] moves it to

    soft tab tes<caret>ting

I imagine this is useful if what you are writing depends on the absolute
position of the characters (a hard-coded text table, ascii art, etc), but it
is less useful if you are writing code.



Steve King-8 wrote:
> 
> On 2011-02-28 20:31, Saiwing Yeung wrote:
>> I have a weird problem in which the caret moved in an unexpected way.
>> Let's say I have
>>
>> test<caret>\n
>>
>> and type command-], it becomes
>>
>> <tab>tes<caret>t\n
> 
> I'm also seeing the behavior you describe. Funny, I never noticed it 
> before... I think that's because I use ⌘] and ⌘[ almost exclusively to 
> move multiple lines at a time. If I want to indent/outdent a single line 
> I just go to the beginning of the line and insert/remove a tab.
> 
> Which suggests a solution. Maybe create a macro to select the line 
> before moving it? It's not ideal, but it may be better than having the 
> caret end up in an unexpected position.
> 
> FWIW, I think you're correct that it has something to do with using a 
> single character (tab) to represent more than a single character width. 
> The behavior changes somewhat if you use soft tabs.
> 
> 
> -- 
> Steve King
> Sr. Software Engineer
> Arbor Networks
> +1 734 821 1461
> www.arbornetworks.com <http://www.arbornetworks.com/>
> 
> 
> 
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
> 

-- 
View this message in context: http://old.nabble.com/shift-right-and-caret-position-question-tp31037293p31043342.html
Sent from the textmate users mailing list archive at Nabble.com.



More information about the textmate mailing list