Disable removal of whitespace at the end of an empty line in Sublime Text 2

sublime-text-2

If I have this sample code:

function foo()
{
    var bar = 1;
    var foo = 1;
    // These two lines will be indented on save,
    // however the following line will have it's indention removed:

    return foo + bar;
}

How can I make Sublime Text 2 stop removing the indention on lines only containing whitespace?

If possible I would still like it to remove it from lines which contains other characters than whitespace.

Best Answer

I found out that setting trim_automatic_white_space to false solved my problem.

However it doesn't work when enabling trim_trailing_white_space_on_save.