Sublime Forum

[BUG]Wrap in quotes, international keyboard layout

#1

Hello there,

I’m from Brazil and using a macbook, so I use the US-International keyboard layout. When I type single or double quotes I normally have to press another key before the final character is printed. That’s how I do á é í ó ä ë ö, etc. The problem is, the action to print a quote sign alone is

[quote] -> [Space] (First press the quote key, and after that hit space), and when I do that in sublime the selection is transformed into ‘’ or “” ( two single or double quote character).

Exemple (with double quotes):
US Layout

selected code to be wrapped ===> "selected code to be wrapped"

US-International Layout

selected code to be wrapped ===> ""
0 Likes

#2

I’m having the same problem

0 Likes

#3

I use US International too and I don’t have this problem.
So I don’t think it’s an error with locales.

Do you guys have regular QWERTY keyboards or other layouts?

0 Likes

#4

Open the console, type these 2 lines to enable log:

sublime.log_input(True) sublime.log_commands(True)
and try it again.
The console must log your keypress and the command that are executed.
If you don’t understand the output, copy/past to this thread.

0 Likes

#5

I have the same problem and it really bugs me. I have enabled logging and this is the result:

Using the US keyboard config:

chr evt: " (0x22)
command: insert_snippet {"contents": "\"${0:$SELECTION}\""}

Using the US-International keyboard config:

chr evt: " (0x22)
command: insert_snippet {"contents": "\"$0\""}

In my US-International keyboard config I need to press the quote key and hit space or another key after for the command for the character event to be triggered, somehow, due to this, sublime uses a different snipped and forgets about my selection.

I use this a lot and could not find a way to fix it, I would love if someone could help me fix it.

0 Likes

#6

I also have this problem. Let me explain a little further because it can be a little tricky to understand this.

In the regular US Mac keyboard there are keys we, portuguese speakers (and a lot of other), use to make the words like: ` " and so on. But Apple didn’t do a keyboard for us like they do for french speakers, so we have to use the US standard keyboard. In fact it’s not a big deal, the keyboard is almost exactly the same as ours. What changes is the behavior of these keys.

For us, the system “waits” for a key to be pressed after these special signs. So if I press ~ the system will wait until I press another key… if I press a key that can combine with that sign, the system joins them as a whole symbol. In this example, if I press ~ then a it will output ã. Quotes are also special because they do a sign we use in letter u (so u + " = ü)…

It is a thing about the keyboard and the OS, not exclusive with OSX or Macs. Windows does that too if you are using an US keyboard trying to write in portuguese. So I guess there are a lot of users with this very same problem.

Thank you!

EDIT: putting quotes into context

0 Likes

#7

I also have the same problem, has anyone managed to fix it?

0 Likes

#8

Hi,
For solving in mac OSX
i had same issue and i change my mac[el captain] keyboard from US International >> to U.S.

everything it ok

0 Likes

#9

This is weird. I also use US International (I’m from the Netherlands) and I’ve never had any problems with quotes or anything. I’ve used Ubuntu and Windows, so maybe it’s some specific problem for mac OSX.

0 Likes