microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.73k stars 28.71k forks source link

Have Shift+Tab remove whitespace within a line #36809

Open alexdima opened 6 years ago

alexdima commented 6 years ago

Extracted from https://github.com/Microsoft/vscode/issues/32280#issuecomment-333843440

From @martinsuchan


Shift+Tab does not outdent. Tested in *.ps1 files. No idea if this has worked in previous versions, just noticed it now.

Edit it works when I'm on the start of the line, but not in between strings. In VS2017 it works even between strings. Not sure it this is native VS behavior or ReSharper, but I use it a lot. tab gif

alexdima commented 6 years ago

Please note that shift+tab always works, it just always operates on the beginning of a line:

kapture 2017-10-24 at 12 24 38

Fl4v10 commented 6 years ago

So, did you find out a solution?

komali2 commented 5 years ago

This has suddenly stopped working for me. Randomly today shift+tab started navigating around the UI rather than outdenting. /shrug

komali2 commented 5 years ago

My coworker doesn't remember how he figured this out, but if this happens to you, hit ctrl+m (or whatever the equivalent is on your machine). Now tab goes back to normally functionality.

umpirsky commented 5 years ago

Above worked for me, toogle tab key moves focus (ctrl + m) toggles this unwanted behavior. Thanks @komali2

FelixK15 commented 4 years ago

Is there a solution for this? Coming from Visual Studio, where I used in-line outdent all the time, this is a big friction point when working with VS Code. I'd also be fine with installing an extension.

Carleux commented 3 years ago

The default value for the command "outdent" is "ctrl + [" This default value might have been shift + tab in previous versions. I noticed the same issue described in this but, and I was able to get back the desired behavior after updating the key binding to shift + tab

CIA-Giphy-1266

FelixK15 commented 3 years ago

Nope, that's not the desired behavior unfortunately.

See this example: outdent_bug

The desired behavior would be that the outdent happens at the cursor position, not the beginning of the line.

FelixK15 commented 3 years ago

Basically, what is needed to fix this is an inverse of the tab command.

kalogs commented 3 years ago

Let's make a group, then when it's thousands of members, invoice Microsoft for the replacement of our backspace buttons until they add the functionality...

But seriously, is there any way to add the desired behavior yet?

FelixK15 commented 3 years ago

This issue has been open for over 3 1/2 years. Something that, I suppose, is a one line fix. This is sad :(

komali2 commented 3 years ago

This issue has been open for over 3 1/2 years. Something that, I suppose, is a one line fix. This is sad :(

on the other hand if you manage to get it fixed and a PR in you can add

microsoft vscode (twenty trillion stars on github) contributor

to your resume!

hediet commented 2 years ago

Nope, that's not the desired behavior unfortunately.

See this example: outdent_bug

The desired behavior would be that the outdent happens at the cursor position, not the beginning of the line.

Shouldn't backspace just remove the "tab" or am I missing something?