2

When clicking anywhere inside my code, Visual Studio will automatically highlight the closest character. For example, let's say I have the following code:

int add()
{

}

If I were to click in between the parenthesis's to insert an argument, Visual Studio would automatically select the ) character. Meaning, if I added the argument num1, my code would become:

int add(num1
{

}

No matter how many times I click, Visual Studio will always highlight the nearest character, which is very annoying when editing existing code, as I will be required to re-enter every character I overwrite.

To be perfectly clear about what I am trying to explain, here is a screenshot of Visual Studio working its magic:

enter image description here

This happens for all languages, not just C++. Does anyone know how I can disable this?

John Landon
  • 2,121
  • 2
  • 12
  • 11
  • Are you referring to the automatic brace completion option? – Samer Tufail Sep 09 '17 at 15:57
  • @SamerTufail No. – John Landon Sep 09 '17 at 15:59
  • 3
    The text editor can operate in insert or overtype mode. It is indicated on the status strip at the bottom, shows up as INS or OVR. And it is visible from the cursor shape, it is a line in INS and a block in OVR. Pressing the Insert key toggles between modes, maybe that is what you did. [More here](https://stackoverflow.com/questions/5089876/text-overwrite-in-visual-studio-2010) and [here](https://stackoverflow.com/questions/31164650/visual-studio-permanently-disable-overwrite). – Hans Passant Sep 09 '17 at 16:01
  • @HansPassant You are correct. Thank you! – John Landon Sep 09 '17 at 16:02

2 Answers2

1

Press the insert key on your keyboard.

double-beep
  • 5,031
  • 17
  • 33
  • 41
0

For some the “Insert Key” will be “ins” for short and coupled with another key for example on my keyboard my 0 key is also my insert key and says “ins” under the 0