Tab key not working in VS2010

10

After an upgrade to VS2010 from VS2008 for C# and Fortran development I have noticed some peculiar behavior. While editing source files (.cs, .for, .f90) my tab key does not insert a tab character, it won't indent code and it won't code complete. I tried it with VS2008 and everything works fine. Note that shift-Tab works ok to un-indent.

I tried devenv /safemode and I did fix things.

If anyone has seen this before please give me a hint as how to fix this issue.

OS is win7-64 SP1

ja72

Posted 2012-05-25T14:11:59.697

Reputation: 411

Answers

2

I decided to brute-force fix the issue by going into Options/Environment/Keyboard and bind the [Tab] key with the Edit.InsertTab command for the Text Editor feature. See screenshot below:

Keyboard Options

That seems to have fixed my problem.

Thanks.

ja72

Posted 2012-05-25T14:11:59.697

Reputation: 411

17

I am seeing this problem as well. The following option seems to be the one that triggers the behavior:

Text Editor | C/C++ | Formatting | Automatic Indentation On Tab

If the above setting is True, the tab key will 'fix' the entire line so that it's indented according to how the IDE believes it should be indented (no matter where the cursor is on the line).

Changing the setting to False makes the tab key work as I expect it to. I don't know how this setting got set to True on my machine.

VS 2012 also has this setting, and it works the same way.

Michael Burr

Posted 2012-05-25T14:11:59.697

Reputation: 470

1I had this as well, completely out of the blue. – PAK-9 – 2014-10-09T15:34:42.510

1Same problem and solution in VS2013. But never saw it in VS2010. – Doug Null – 2015-02-28T00:28:42.520

1I also saw this behavior today for the first time, after I installed "Update for Visual Studio 2013 Update 1". It was set to true out of nowhere. – Ray – 2014-03-12T17:08:42.537

-1

As a workaround, try pressing Alt-009 (press and hold Alt, then press 009 on a numeric keypad, then release Alt). That should generate a tab character. (The "alt-numbers" function doesn't work using the numbers across the top of the keyboard - you must use a keypad.)

You might need to submit a bug report to Microsoft.

Tom

Posted 2012-05-25T14:11:59.697

Reputation: 1 321