Reputation: 14539
In Visual Studio Code, when pressing the Delete button at the end of a current line:
[]<- a currsor is here
)
, a text on a next line obviously jumps to the current line and it becomes something like this:
[] )
So we have a bunch of spaces in the joined text (between square brackets and paranthesis in the example above), so we have to delete them manually.
In the "big" Visual Studio (maybe because of ReSharper) all those spaces get deleted automatically and immediately, with a single Delete stroke, we have what we wanted to do:
[])
How can we remove those spaces with Visual Studio Code automatically? Is there a setting for this?
Upvotes: 4
Views: 3245
Reputation: 181319
Actually, while making a macro to do what you wanted, I see that Ctrl+Delete does exactly what you want when at the end of a line.
If you wanted to only use the Delete key and nothing else, you will need an extension of some kind. A macro could do the job but it sounds like you want the Delete key to work differently within a line of code than from at the very end. Something a macro would not be able to distinguish. An extension could do that.
But I suggest just use the simple Ctrl+Delete.
Upvotes: 3
Reputation: 12769
I'm fairly sure there is not a command or setting like this built in to VSCode.
However, there is an extension called Hungry Delete that does something similar, although not quite what you've asked for. I suggest trying to modify it; I doubt it would be difficult. Whatever logic you come up with can be bound to Delete, supplanting the usual behavior.
Of course, if you haven't written an extension before, start with the (quick) tutorial first.
Upvotes: 2