Quite often I see code formatted like this in questions:
foo
bar
hello
If the code consists of sufficiently long lines, it ends up looking like this:
foobasdsdlfkasdlfksdfoobasdsdlfkasdlfksd
It'd be nice if there was a way (an icon to click or a magic keyboard incantation perhaps) to correct those two code blocks to:
foo
bar
hello
and
foobasdsdlfkasdlfksdfoobasdsdlfkasdlfksd
respectively.
Presumably this could work by looking at the lowest number of spaces x
in the selected block, and then reducing the number of initial spaces on each line by x-4
.
Obviously, there are a small minority of languages where spaces are meaningful that this might change the meaning of, but in most cases I think this would be useful.
I'm aware that I can cut and paste the code into my editor of choice to do this, but it'd be nice if there was some built-in way to do this.