Sublime Forum

Cannot type closing bracket "}"

#1

In PHP mode, every time I press the closing bracket “}”, instead of typing that, an html comment appears (). The same happens in CSS mode. It’s driving me NUTS.

In order to type the “}” character, in a spanish keyboard I have to press Alt Gr and then the key next to the “enter”, take a look:

If I enable sublime.log_input(True) in the console, when I press the key, this is what appears:

key evt: control+alt+/

How can I avoid that behavior?

0 Likes

#2

Hello? This is a pretty important problem. I mean, I’m a programmer and I use that character a lot. No solution? WTF?

0 Likes

#3

You could make a keybinding in your user key bindings like this:

{ "keys": "ctrl+alt+/"], "command": "insert", "args": {"characters": "}"} }
0 Likes

#4

Thanks, it’s worked.

It’s a shame this kind of things do not work out of the box.

0 Likes

#5

Actually, AFAIK Sublime Text doesn’t support International Keyboard Layouts, or at least the super-function keys like the right alt key (the “Alt Gr” on your keyboard).
Each time that a shortcut uses one of those keys for a shortcut and uses the alt key then it will not only not work correctly but also disable the super-function of that key.

Example, in the Portuguese Layout Keyboard, the “0” key also has the “}” character acessible through “right_alt + 0” which is different than “left_alt + 0” which produces nothing.
If you define a key binding, say “ctrl + alt + 0” (to whatever action you want) the “right_alt + 0” key stops working (you can’t write the character “}” anymore.

0 Likes