[TxMt] Toggle Comment with no selection
Charilaos Skiadas
cskiadas at uchicago.edu
Mon Nov 7 15:16:41 UTC 2005
On Nov 7, 2005, at 9:08 AM, Jonas Witt wrote:
> On 07.11.2005, at 15:57, peter royal wrote:
>
>> I keep hitting the 'Toggle Comment' command with no selection,
>> expecting it to work on the current line only, but it does the
>> whole file. I find this behavior counter-intuitive. Does anyone
>> else? And if so, is it possible to have it changed?
>>
>
> I would like to second that request. If I want to comment
> everything (which is rare enough), I can easily do Cmd-A Cmd-/.
> This change of behaviour would be really useful. If Allan doesn't
> want to change the default behaviour, maybe it would be possible to
> add a (hidden?) option for it?
>
I think the logic behind it is that it follows the general principle
that a command accepts as input either a selected text or, in the
absence of selected text, the entire document.
It makes very good sense in most cases, and I consider the
consistency in the behavior very important.
It is probably just one extra keystroke to select the line, right? I
admit it doesn't happen often that you would want to uncomment the
entire document.
I wouldn't object to the presence of a variable setting this behavior
though.
But I feel it should be easy to change the command in the uncomment
bundle to just work on the given line if there is no selection.
> Jonas
>
Haris
More information about the textmate
mailing list