Home Download Buy Blog Forum Support

Toggle comment not working on Windows for me

Toggle comment not working on Windows for me

Postby zigomir on Fri Jan 20, 2012 10:26 pm

Hi,

I'm having this trouble with sublimetext 2. Same shortcut is used with IntelliJ IDEA, but I'm not running it right now, so I don't know if the problem is in overlapping or ... how can I be sure?

Thanks!
zigomir
 
Posts: 5
Joined: Fri Jan 20, 2012 10:24 pm

Re: Toggle comment not working on Windows for me

Postby zigomir on Sat Jan 21, 2012 1:55 pm

No, it doesn't work even on computer without IntelliJ IDEA. Sucks :(

So, again, I', using 32 bit build of 2165 on (Windows 7 32 and 64 bit tested).
zigomir
 
Posts: 5
Joined: Fri Jan 20, 2012 10:24 pm

Re: Toggle comment not working on Windows for me

Postby ToddFiske on Sat Jan 21, 2012 5:57 pm

It works for me on both Win 7 and Vista.

What type of file are you in? Commenting works differently for different file types. For example it doesn't do anything on text files. In a JSON file (like a preferences file) it gives a line comment for ctrl+/, and a block comment for ctrl+shift+/. What are you trying to do?

I can't imagine it would have anything to do with IntelliJ IDEA just because it uses the same keypress. But it may be affected if you have Ctrl+/ assigned to something in AutoHotKey or the like.
ToddFiske
 
Posts: 38
Joined: Wed Nov 04, 2009 10:43 pm

Re: Toggle comment not working on Windows for me

Postby zigomir on Sat Jan 21, 2012 10:15 pm

It's not IDEA problem, I've checked. I'm testing on commenting html and ruby code. If I go through menu: Edit > Comment > Toggle Comment ... than it works, but not with key shortcut. Also all other shortcuts works ... like ctrl + p or ctrl + shift + p and so on...
zigomir
 
Posts: 5
Joined: Fri Jan 20, 2012 10:24 pm

Re: Toggle comment not working on Windows for me

Postby ToddFiske on Sun Jan 22, 2012 4:31 am

I was able to get toggle_comment to work on both html and ruby file types. Since you say it works from the menu, it suggests that there are some changes in your key bindings.

You could define your own shortcut to it to test that it works. Open "Key Bindings - User" from the Preferences menu and add this:

Code: Select all
    { "keys": ["ctrl+\\"], "command": "toggle_comment", "args": { "block": false } }


Put it between the square brackets if the file is new, or Include a comma before or after if you already have other entries.

Note that I used control + Backslash, which is unlikely to have anything bound to it. You have to escape the backslash with itself.

If this works to comment a line and Ctrl + Forward Slash doesn't, it means something else in your Sublime config or your system is using that keystroke.

Another way to test is to try it with an unmodified portable install, or use the revert process from http://www.sublimetext.com/docs/2/revert.html.
ToddFiske
 
Posts: 38
Joined: Wed Nov 04, 2009 10:43 pm

Re: Toggle comment not working on Windows for me

Postby zigomir on Sun Jan 22, 2012 11:17 am

Thanks for help!

I've defined new keymap in Key Bindings - User. It didn't work with ctrl+\\ so I tried ctrl+q for test. It works. It works with alphanumeric characters.
ctrl+/ is defined only at one place in Key Bindings - Default...so I don't really get what is the problem.

I tried with portable install before too, no luck with ctrl+/.
zigomir
 
Posts: 5
Joined: Fri Jan 20, 2012 10:24 pm

Re: Toggle comment not working on Windows for me

Postby atomi on Sun Jan 22, 2012 8:47 pm

Sometimes plugins override default key bindings.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Toggle comment not working on Windows for me

Postby bizoo on Mon Jan 23, 2012 6:59 am

For me on Windows 7 64, the keybindings for non numeric or character char. is not the actual char. printed on the key, but the position of the key (keycode ?).
So the key for the comment ('/') is the first key on the first row, right before the 1 key (for me '§').
Working like this make sense cos actually the '/' key is a second choice char. on my keyboard, so I couldn't trigger ctrl+/ without adding shift key.
But I don't know why it's this key ??? (maybe Jon could help ?)

Try it.
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Toggle comment not working on Windows for me

Postby zigomir on Sat May 11, 2013 9:54 am

Finally it works for me. I needed to use this http://www.randyrants.com/2006/07/sharpkeys_211.html tool to help me out. If anyone has also this problem just rebind your key like this Image
zigomir
 
Posts: 5
Joined: Fri Jan 20, 2012 10:24 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 22 guests

cron