Can't print } on Visual Studio 2017 on Italian

2019-01-24 13:59发布

When I press the keyboard shortcut CTRL+ALT+SHIFT+] on an Italian keyboard to add a closed curly brace, Visual Studio selects a block of my code instead of printing it. I have already tried to reset the keyboard mapping on Visual Studio but to no avail.

Other programs works without problems. How can I fix this problem?

1条回答
唯我独甜
2楼-- · 2019-01-24 14:31

It is a new feature appeared in Visual Studio 2017 version 15.8.0.
It is called ExpandSelectionToContainingBlock and it is mapped to the keyboard shortcut CTRL+ALT+SHIFT+] or CTRL+ALT+SHIFT++ (For VS in Italian)

But this mapping has removed the ability, from some keyboards without the key for the closing brace (like the Italian one), to press those keys and get the, indispensable for many programming languages, close curly brace.

As far as I know there are two workarounds

  1. Go to Tools menu and select Customize
  2. Press the Keyboard button
  3. Search for Edit.ExpandSelectionToContainingBlock
  4. Press Remove

or just use the numeric keypad and press

ALT+0125

For Italian readers with the Italian version of VS, the search above at point 3 should be for Modifica.Espandiselezioneabloccocontenitore. I don't know if other languages are affected by this 'translation vice' but it is a thing to be aware of.

The problem has already been reported to MS (Thanks Albireo)

EDIT: It seems that they have fixed the problem, in version 18.5.2 there is anything assigned to the shortcut. But I am not sure if this is an effect of my previous action or if this (no shortcut) is the real default now.

查看更多
登录 后发表回答