TrailingSpaces icon indicating copy to clipboard operation
TrailingSpaces copied to clipboard

Should not trim current line on save given these settings

Open pavellishin opened this issue 9 years ago • 2 comments

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.

pavellishin avatar Dec 05 '15 17:12 pavellishin

(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?

Vlad-Shcherbina avatar Feb 08 '16 21:02 Vlad-Shcherbina

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.

pavellishin avatar Feb 17 '16 18:02 pavellishin