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

Can't disable plugin #202

Open
MeShootIn opened this issue Nov 25, 2022 · 6 comments
Open

Can't disable plugin #202

MeShootIn opened this issue Nov 25, 2022 · 6 comments
Labels
Bug Help wanted PRs welcome!

Comments

@MeShootIn
Copy link

Problem

Command :EditorConfigDisable, which although not present in the documentation, and setting (manually via Vim Command mode and via ".vimrc") buffer variable (:let b:EditorConfig_disable = 1) don't disable plugin.

Steps to reproduce

  1. Open a test file containing only one string "test"
  2. Try to disable the plugin using a command or variable
  3. Enter Insert mode, add some extra spaces at the end of the line and return to Normal mode
  4. Save the file by typing :w

And after that all extra spaces from the end of the line are removed, which indicates that the plugin is still working. I even tried to run Vim (vim -u ./.minimal_vimrc ./test.txt) and Neovim (nvim -u ./.minimal_vimrc ./test.txt) with a minimum config (all files are below), but the plugin still wasn't disabled.

My configuration

  • OS: Windows 10
  • Vim version: 8.2.5117
  • Neovim version: 0.8.1
  • Vim plugin manager: vim-plug
  • Neovim (sources Vim config) plugin manager: packer.nvim

Minimal config "./.minimal_vimrc"

call plug#begin('~/AppData/Local/nvim/plugged')
Plug 'editorconfig/editorconfig-vim'
call plug#end()

"./.editorconfig" file

root = true

[*]
trim_trailing_whitespace = true
@cxw42
Copy link
Member

cxw42 commented Dec 10, 2022

Confirmed; thanks for reporting! :EditorConfigDisable does not clear the autocmds in all the groups, notably editorconfig_trim_trailing_whitespace.

:autocmd editorconfig_trim_trailing_whitespace
--- Autocommands ---
editorconfig_trim_trailing_whitespace  BufWrite
    <buffer=1>
              call s:TrimTrailingWhitespace()

@cxw42 cxw42 added Bug Help wanted PRs welcome! labels Dec 10, 2022
@kevin61416
Copy link

Hi All, any update on this issue?

@cxw42
Copy link
Member

cxw42 commented May 27, 2023

Not from me --- sorry! PRs are always welcome, however :) .

@xuhdev
Copy link
Member

xuhdev commented Jun 2, 2023

Are you seeking to disable for only a selected buffer?

@MeShootIn
Copy link
Author

@xuhdev yes.

@k-takata
Copy link
Contributor

k-takata commented Jun 2, 2023

:help tabpagebuflist() shows how to get a list of all buffers in all tabs:

			let buflist = []
			for i in range(tabpagenr('$'))
			   call extend(buflist, tabpagebuflist(i + 1))
			endfor

Maybe useful for disabling autocmd in all the buffer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Help wanted PRs welcome!
Projects
None yet
Development

No branches or pull requests

5 participants