Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't print } on Visual Studio 2017 on Italian keyboard [duplicate]

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?

like image 666
MyAlexro Avatar asked Aug 18 '18 14:08

MyAlexro


People also ask

How do you make a curly bracket on an Italian keyboard?

On Italian keyboard, you can type curly braces ("{" and "}") by typing Alt Gr + Shift + è and Alt Gr + Shift + + , respectively (see picture below, taken from this question). The "è" and "+" characters do not need any key combination, you just press the corresponding key.

How do you match braces in Visual Studio?

Go to matching brace in Visual Studio with Ctrl+} shortcut To move the caret to the matching brace of the one it's currently on press Ctrl+}. This is very handy for navigating code which might have multiple levels of if/else block nesting, although do try and avoid this kind of code by using guard clauses if you can.


1 Answers

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.

like image 99
Steve Avatar answered Sep 29 '22 07:09

Steve