- Code: Select all
| line 1
| line 2
If I hit shift+tab twice, I end up with this:
- Code: Select all
|line 1
| line 2
If I then hit tab twice in a reactionary attempt to fix my wrongdoing (as I am wont to do), I get this:
- Code: Select all
| line 1
| line 2
Clearly if I select an entire line (including the newline) I don't want to indent the next line—I think "indent" has the correct behavior here. However, I think "unindent" does the wrong thing: perhaps it could ensure that the selection on the last line remains inside the line after unindenting? E.g.
- Code: Select all
| line 1
| line 2
becomes
- Code: Select all
| line 1
|line 2
after hitting shift+tab once, and
- Code: Select all
|line 1
line| 2
after hitting shift+tab a second time.
Clearly this has the side-effect of a semantic change to my selection, but I'd rather have that than have to manually fix the last line. And if the selection remains the same number of characters inside the last line after both unindent and indent, then it would be semi-symmetrical as long as the line didn't become shorter than the amount of whitespace you've chopped off with unindent.