Fix an issue with the "Restore whitespace" preference

Only restore trailing whitespace on the current line if it was removed.

Bug reported by Jürgen Hermann.

Refs #2