Skip to content

'autocmd BufWritePre * StripWhitespace' breaks 'ToggleStripWhitespaceOnSave' #54

@docwhat

Description

@docwhat

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

  1. Put autocmd BufWritePre * StripWhitespace in your .vimrc or .config/nvim/init.vim.
  2. Edit a file that isn't in the black list.
  3. :ToggleStripWhitespaceOnSave.
  4. Add trailing whitespace.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions