[TxMt] Pasting and indents

Allan Odgaard allan at macromates.com
Fri Jun 10 18:31:20 UTC 2005


On Jun 10, 2005, at 17:20, Jack Baty wrote:

> Line #5  shouldn't be indented any more than line #6, yet it's
> indented with 2 additional tabs (or set of 4 spaces, doesn't matter
> which I use). That's not supposed to happen, right?

The reason it changes the indent is because re-indent pasted text is  
enabled in the preferences.

As for your double-indent, the reason for that (i.e. the reason the  
re-indent of pasted text is not smart enough to do it right) is  
because you do not select from the beginning of line 2, but instead  
skip the two tabs.

So what you actually store on the clipboard is this:

@todos = Todo.find(:all, :include => [:users, :job])
     render_partial_collection "todo", @todos

TextMate will then re-indent that to where you paste it, meaning  
inserting two tabs in front of _both_ lines.

I have on the to-do that it should store the current indent of copied  
text on the clipboard, which should solve this copy/paste pattern,  
but for now try to remember selecting from the beginning of the line  
when you do copy/paste, and I think you'll find it to work much better.





More information about the textmate mailing list