microsoft / vscode

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

Trim whitespace when deleting newline #134898

Open OlafvdSpek opened 3 years ago

OlafvdSpek commented 3 years ago

When I delete a newline, I always have to delete the leading whitespace too. Could this whitespace be trimmed automatically?

void f() {
    int a = 1
        + 2;    
}

If the cursor is after the 1, I'd like one press of Delete to delete both the newline and the whitespace before the +.

adityavc commented 7 months ago

Hello, I would like to contribute to this. Is it still open/needed?

OlafvdSpek commented 7 months ago

It is.

adityavc commented 6 months ago

210870 -- I worked on this issue a little bit and opened a pr (main changes were adjusting the deletion range when a new line character is deleted)