51

I am using Visual Studio 2015 and ReSharper 2016.2 and I have this strange behavior, that I probably activated (accidentally). When having the cursor in a line before the first word, hitting the Tab-key indents the line correctly:

enter image description here

When the cursor is inside of any word inside the line, hitting the Tab-key selects the word or block.

enter image description here

But the desired behavior would be to indent at the cursor (e.g. split a word into two words, if the cursor was inside of the word Stream after the letter r):

enter image description here

Does anyone know how this 'feature' is called? Does it come from ReSharper? Where can it be enabled or disabled?

Alexander Pacha
  • 9,187
  • 3
  • 68
  • 108

3 Answers3

67

Go to Resharper -> Options, in the left treeview select Editor Behavior and uncheck the last option Use Tab/Shift Tab keys for structural navigation.

enter image description here

Update for Resharper 2016.3.1.

Thanks to @Jordan for pointing this out!

Updated for Resharper 2016.3.1

Karel Tamayo
  • 3,690
  • 2
  • 24
  • 30
  • 1
    Still the correct answer for Resharper 2016.3.1 with the exception of an added option "The caret is in a comment or string literal." – Jordan Feb 09 '17 at 16:59
  • 1
    Almost 7 years later and this answer is still relevant. Just saved me some headache when I couldn't figure out why hitting [Tab] in VS 2022 was not inserting space but instead selecting a block of code. – Lee Mar 18 '23 at 02:07
4

This is called Structural Navigation, and is really useful for tabbing between blocks of code, e.g. parameters in a method call/definition - makes it very easy to edit. The behaviour can be changed in the options, under Editor Behaviour. More details in the docs.

citizenmatt
  • 18,085
  • 5
  • 55
  • 60
0

Turn it off and use your pointer to "navigate" to the structure you want to edit. That way you can continue to add tabs to your comment blocks until they fix the otherwise useless feature. Somebody over there has too much time on their hands solving non-existent problems, and actually making things worse. They have the comment behavior of this "feature" listed as a bug. Should be fixed by 2018.

Rick O'Shea
  • 1,410
  • 19
  • 15