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

Add the ability to disable EditorConfig per-buffer #154

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

midchildan
Copy link
Contributor

@midchildan midchildan commented Oct 15, 2020

This PR introduces a buffer-local variable, b:EditorConfig_disable, that would allow users to disable EditorConfig for specific filetypes, or create their own rules for disabling.

Solves #104.

Copy link
Member

@cxw42 cxw42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for this PR! I have left a few comments suggesting changes.

Before merging, I would like two structural changes. Please:

  • In plugin/editorconfig.vim, move the check up to line 205, before "Check if any .editorconfig does exist". If b:EditorConfig_disable is set, I don't think we need to look for any .editorconfig files. That will make the plugin more responsive on b:EditorConfig_disabled buffers.
  • Inside the if b:EditorConfig_disable block, please add a modified copy of lines 225-228 to tell the user that the buffer is being skipped (if g:EditorConfig_verbose is set). That will make debugging "why doesn't this work???!" failures substantially easier :D .

Much appreciated!

plugin/editorconfig.vim Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
doc/editorconfig.txt Outdated Show resolved Hide resolved
This would allow users to disable EditorConfig for specific filetypes,
or create their own rules for disabling.
@midchildan
Copy link
Contributor Author

Thanks for reviewing! I've pushed a fix.

@xuhdev xuhdev requested a review from cxw42 October 19, 2020 02:35
Copy link
Member

@xuhdev xuhdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @cxw42's comments and the PR LGTM now.

Copy link
Member

@cxw42 cxw42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate for the edits --- looks good to me, and works fine in my (admittedly brief) testing. Thanks very much for contributing, and happy Vimming to you! :)

@cxw42 cxw42 merged commit 8f6eba5 into editorconfig:master Oct 21, 2020
@midchildan midchildan deleted the feat/disable-per-buffer branch October 21, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants