TrailingSpaces icon indicating copy to clipboard operation
TrailingSpaces copied to clipboard

Disabling removal of whitespace on the current empty line on save

Open gabrielecirulli opened this issue 11 years ago • 2 comments

Hey, apologies if this issue has already come up in the past but I really can't find a solution using the available settings.

I often find myself opening a new block (say a function) and going to a new line where there's only really the indentation. I will then switch the window to my browser and, since I have automatic saving enabled, it'll save and trim whitespace, including the indentation on the current line which is needed for me to be able to write the code inside the function later. I tried "trailing_spaces_include_empty_lines": false but at that point it'll ignore all empty lines, which is not what I want because I'd like empty lines with stray indentation to be removed correctly.

Is there a way to make it ignore the current line if it's empty but only because I have my cursor on it, and delete all other empty lines?

gabrielecirulli avatar Jul 31 '13 21:07 gabrielecirulli

+1 for this.

randy3k avatar Jun 16 '14 08:06 randy3k

I have written Whitespace which supports it.

randy3k avatar Jul 26 '14 08:07 randy3k