SublimeText / TrailingSpaces

Highlight trailing spaces and delete them in a flash.
MIT License
897 stars 94 forks source link

Should not trim current line on save given these settings #97

Open pavellishin opened 8 years ago

pavellishin commented 8 years ago

My current user settings are:

{
    "trailing_spaces_trim_on_save": true,
    "trailing_spaces_include_current_line" : false
}

I believe that this means that my current line should not be trimmed when I hit save, but it does get trimmed.

Vlad-Shcherbina commented 8 years ago

(just another user here) According to the documentation in default config, trailing_spaces_include_current_line affects what is displayed, not what is trimmed (unlike, say, trailing_spaces_modified_lines_only).

In my opinion, this behavior makes sense. The idea is to avoid constant flashing with trailing whitespace highlights as one types text with spaces. I can imagine situations where you might want to trim current line only, but trimming all but current line?.. Do you have a usecase for that?

pavellishin commented 8 years ago

Sorry for the late reply, life's a bit hectic at the moment.

According to the documentation in default config, trailing_spaces_include_current_line affects what is displayed, not what is trimmed (unlike, say, trailing_spaces_modified_lines_only).

Ah, okay, you're right - I should have read that more closely.

Do you have a usecase for that?

I'm a habitual CMD-S typer, and when I'm in the middle of an indented block of code, it's a little annoying to have my cursor get reset to the start of the line. Basically, any time when you're in the middle of something and want to save and come back in a minute without being sent to the start of the line.