autocmd BufWritePre * StripWhitespace doesn't set g:strip_whitespace_on_save to 1. This breaks ToggleStripWhitespaceOnSave because it'll be the default (0).
How to reproduce
- Put
autocmd BufWritePre * StripWhitespace in your .vimrc or .config/nvim/init.vim.
- Edit a file that isn't in the black list.
:ToggleStripWhitespaceOnSave.
- Add trailing whitespace.
- Save (
:w)
What happened
The whitespace was stripped on save.
What I expected
The whitespace should not be stripped because I toggled it from the default (enabled) state.