Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip whitespace on save with highlighting disabled #136

Open
itaranto opened this issue Jun 26, 2020 · 3 comments
Open

Strip whitespace on save with highlighting disabled #136

itaranto opened this issue Jun 26, 2020 · 3 comments

Comments

@itaranto
Copy link

I tried:

let g:better_whitespace_enabled=1
let g:strip_whitelines_at_eof=1
let g:strip_whitespace_on_save=1

and

let g:better_whitespace_enabled=1
let g:better_whitespace_filetypes_blacklist=['diff', 'gitcommit', 'unite', 'qf', 'help', 'markdown']
let g:strip_whitelines_at_eof=1
let g:strip_whitespace_on_save=1

and with both configurations I had the confirmation prompt in markdown files.

Is there something I'm doing wrong?

@Cimbali
Copy link
Collaborator

Cimbali commented Jul 17, 2020

This is the setting controlling the confirmation prompts, is that the one you’re looking for?

`g:strip_whitespace_confirm`                      (defaults to 1)
Set to 0 to deactivate asking for confirmation before whitespace is
stripped when you save the file.

If not please try to be more specific in what you’re trying to achieve and what is happening instead.

@itaranto
Copy link
Author

I'm sorry I wasn't clear enough. This is't about the confirmation prompt.

My intended use case is to have the trim-on-save functionality but without the highlighting.

So, I attempted this:

let g:better_whitespace_enabled=0
let g:strip_whitelines_at_eof=1
let g:strip_whitespace_confirm=0
let g:strip_whitespace_on_save=1

But it still removes trailing whitespace from a markdown file, i.e a blacklisted file type.

So, I tried using let g:better_whitespace_enabled=1 and now the blacklist works properly.
It seems that the better_whitespace_enabled controls the blacklist access, is that intended?

@Cimbali
Copy link
Collaborator

Cimbali commented Jul 19, 2020

I'm not sure stripping on save without enabling betterwhitespace is currently supported.

@Cimbali Cimbali closed this as completed Jul 19, 2020
@Cimbali Cimbali reopened this Jul 19, 2020
@Cimbali Cimbali changed the title Blacklist doesn' seem to be working with strip_whitespace_on_save = 1 Strip whitespace on save with highlighting disabled Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants