views:

292

answers:

2

I recently upgraded to Visual Studio 2010 and found out that when i press Ctrl-Backspace on a empty line it will delete the line, which is what it did in 2008, but then it will also delete the last character on the line above. I have tried to see if there is any settings anywhere but i cant seem to find any. Does anyone know if you can change this or did they make it default in 2010

Im using C#, if that makes a difference.

A: 

Control-Backspace deletes the word to the left of the cursor. If you are on a blank line and hit it twice it will delete that line and the word above it.

mbcrump
Correct, but i only press it once to delete the line but then it also jumps up to the line above and deletes the word. If i press it again then it will delete the next word on the line above
Chris Watts
Then I would recommend going into Options, then Keyboard and select the VS2005 mapping scheme and hitting Reset.
mbcrump
That did not help.
Chris Watts
+4  A: 

Do you have the caret in virtual space (e.g. after hitting enter from a previous line, and the caret is aligned at the correct indent level)?

If so, this is a bug in the RTM. I've already fixed it in our internal builds, though that's probably not very helpful for you. I went ahead and wrote a small extension that "fixes" the issue, which you can download here. If you are curious, you can also take a look at the workaround in FixCtrlBackspace.cs. It's essentially just overriding the behavior of ctrl-backspace, when the caret is in virtual space, to clear the virtual space.

Let me know if that helps, or if it breaks anything (I didn't test it very heavily).

Noah Richards
Thank you so much! I've been voting for this on MS connect. :)
Ryan
What is the URL for the MS connect bug? I would like to vote it up too!
James
It's already fixed (post RTM), so the upvote won't make much of a difference :)
Noah Richards
Thanks i will update to RTM soon
Chris Watts