TrailingSpaces
TrailingSpaces copied to clipboard
Automatic trailing white spaces on line move
So if I'm on a line of code and I move to another line the trailing spaces are automatically deleted from last line I was on.
Pros:
- When on an
untitledtab where let's say I paste some code and edit it I'll be able to delete trailing spaces by moving from line to line (As of right now I can't delete trailing spaces on save since it's an untitled tab, so I have to callDelete Trailing spaces) - No need to call
Delete Trailing Spacessince it'll just delete all the trailing spaces when I move from line to line. (Yet you'll keep this simply because of people just installing this, and call this on files which they already have trailing spaces) - Your algorithm wouldn't have to search the whole file for trailing spaces, again since it'll do it by moving from line to line.
Cons:
I had one in mind but I already forgot so I'm not sure if there really is any.
So over all this would improve productivity because we don't need to wait till we save file, or call Delete Trailing Spaces
If this is a sure no, perhaps as an option in the settings
Could potentially be annoying in following situation:
- You press enter after writing a line. => Next line gets indented automatically
- You move back to previous line for a moment (maybe you forgot to add semicolon or something)
- You go back to previous line and now indentation is gone so you have to press tab.
That's true and interesting, I can't really think of a way to avoid this, not sure if you can think of one, but perhaps leave this issue open just in case someone does?
To be fair, that auto-added indention is currently removed by ST on typing something on another line. But it still could get more annoying if trailing spaces would just be removed on navigating to another line.