Hi,
I find it continually disconcerting that pressing Cmd+/ without a selection comments out my entire file.
I had a quick look at the Toggle Comments command but couldn't immediately see why it does this or how to stop it.
The behaviour I want is, when there is no selection, to comment out/in the current line.
Is it possible for me to make this change?
Regards,
Matt
-- Matt Mower :: http://matt.blogs.it/
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.