Sublime Forum

[SOLVED] Custom Key Bindings work in 'Key Bindings' editor but not on other files

#1

[SOLVED] It seems to have resolved itself. I’m still confused but hey, it’s working.

Windows 10 x64, ST3 3126.

The Comment shortcut wasn’t working for me (Ctrl+/ or Ctrl+Shift+/) so I changed it to keypad_divide instead. Now I have the following in my (Windows).sublime-keymap - User file:

[
{ “keys”: [“ctrl+keypad_divide”], “command”: “toggle_comment”, “args”: { “block”: false } },
{ “keys”: [“ctrl+shift+keypad_divide”], “command”: “toggle_comment”, “args”: { “block”: true } },
]

The commands work fine in the side-by-side (Windows).sublime-keymap - Default and (Windows).sublime-keymap - User view.

However when I try to open and edit a different file the commands do nothing. The console gives me these, respectively:

key evt: control+keypad_divide
command: toggle_comment {“block”: false}

key evt: shift+control+keypad_divide
command: toggle_comment {“block”: true}

It appears to receive and execute the command but nothing visually changes in the text. From my end it looks like nothing is happening.

I’m at a loss. Any bright ideas for me? Thanks in advance.

0 Likes

#2

what file are you editing that it doesn’t work on? maybe the author of the package you are using to highlight the file hasn’t bothered setting the comment tokens properly, so toggle_comment doesn’t know what characters to use

0 Likes

#3

Any file. I create a new blank one and it doesn’t work. Open old HTML files that I know aren’t protected, nothing.

0 Likes

#4

@kingkeith

Odd, now it randomly works. I must have done something right but it didn’t take right away for whatever reason. Disregard, thanks for the quick reply.

0 Likes