[TxMt] Cmd+/ shouldn't do select-all

Allan Odgaard throw-away-1 at macromates.com
Fri Oct 21 11:16:35 UTC 2005


On 21/10/2005, at 13.06, Matt Mower wrote:

> I had a quick look at the Toggle Comments command but couldn't
> immediately see why it does this or how to stop it.

Recently I made selection as input/output fall back to entire  
document, when there is no selection. One can test for the  
TM_SELECTED_TEXT variable (to see if text was actually selected), but  
in this case it won't be useful, since output replaces entire document.

> [...] Is it possible for me to make this change?

The easiest is probably to record a macro which first does: Edit ->  
Select -> Line, then Toggle Comment.

The Select Line will extended current selection to line boundaries,  
so it should work even when there already is a selection (for line  
mode comments).

If you give the new macro a scope of source.ruby, it'll be more  
specific than source (which the original command uses), so you can  
assign cmd-/ to this new macro w/o touching the org. command.




More information about the textmate mailing list