editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.11k stars 135 forks source link

E37, E162 when starting neovim with a directory #212

Closed pmeinhardt closed 1 year ago

pmeinhardt commented 1 year ago

Thanks for this fantastic plugin. I've been using it for ages and it's been a smooth ride. 🏄‍♂️

Strangely, for a couple of weeks now I encounter the following issue: 🚨

  1. Start with nvim . (opens a netrw buffer)
  2. :q to quit
  3. Raises
    • E37: No write since last change and
    • E162: No write since last change for buffer "…"
  4. Does not quit as I would expect

Invoking :q a second time then quits.

Observations 🔬

I haven't pin-pointed what causes this behavior specifically for neovim. 📍

I appreciate any help or pointers. 🙇

pmeinhardt commented 1 year ago

Some updates, as I had a little bit of time to look into this just now.

For further inspection, I set g:EditorConfig_verbose = 1 in my config. For both Vim and Neovim I get:

Applying EditorConfig vim_core on file "/Users/pmeinhardt/.dotfiles/"

Disabling parts of the code and checking whether the problem occurs, I was able to follow this trail:

https://github.com/editorconfig/editorconfig-vim/blob/1d54632f7fcad38df8e428f349bc58b15af4b206/plugin/editorconfig.vim#L280

https://github.com/editorconfig/editorconfig-vim/blob/1d54632f7fcad38df8e428f349bc58b15af4b206/plugin/editorconfig.vim#L258

https://github.com/editorconfig/editorconfig-vim/blob/1d54632f7fcad38df8e428f349bc58b15af4b206/plugin/editorconfig.vim#L306

https://github.com/editorconfig/editorconfig-vim/blob/1d54632f7fcad38df8e428f349bc58b15af4b206/plugin/editorconfig.vim#L436-L454

And then finally, disabling this line made the issue go away:

https://github.com/editorconfig/editorconfig-vim/blob/1d54632f7fcad38df8e428f349bc58b15af4b206/plugin/editorconfig.vim#L439

Note: my .editorconfig specifies:

[*]
charset = utf-8
pmeinhardt commented 1 year ago

Closed via #213 🥳