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

EditorConfigDisable doesn't reset trim_trailing_whitespace #135

Open
thet opened this issue Feb 6, 2020 · 3 comments
Open

EditorConfigDisable doesn't reset trim_trailing_whitespace #135

thet opened this issue Feb 6, 2020 · 3 comments
Labels
need info Need more information before proceeding

Comments

@thet
Copy link

thet commented Feb 6, 2020

When editing a file with the following .editorconfig loaded:

[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

and setting EditorConfigDisable in vim, trailing whitespace is still removed.

@cxw42
Copy link
Member

cxw42 commented Feb 6, 2020

As with your other issue, thanks for reporting! What steps, file, Vim/OS versions? If we can recreate what you are experiencing, we are more likely to be able to make changes if necessary. Thank you!

@cxw42 cxw42 added the need info Need more information before proceeding label Jun 9, 2020
@whonore
Copy link
Contributor

whonore commented Nov 3, 2020

I can reproduce with Vim 8.2 on Ubuntu 20.04, but I think the problem should happen for any setup. It looks like s:EditorConfigEnable(0) doesn't clear augroup editorconfig_trim_trailing_whitespace.

@inguin
Copy link

inguin commented Dec 18, 2020

@whonore is correct: The trailing whitespace hook is in its own group editorconfig_trim_trailing_whitespace. Calling EditorConfigDisable only clears the editorconfig group but leaves the existing autocmd in place.

I think a bugfix is very easy: The trim_trailing_whitespace autocmd should go into the editorconfig group instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Need more information before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants