editorconfig / editorconfig-vim

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

Spell checking breaks in existing buffer when new opening new file #196

Closed alkim0 closed 2 years ago

alkim0 commented 2 years ago

Setup

Here's the setup for my minimal reproducible example.

In my .vimrc, I have (using vim-plug as my plugin manager):

set spell

call plug#begin()
Plug 'editorconfig/editorconfig-vim'
call plug#end()

In my .editorconfig, I have:

[*]
indent_style = space

Then I have two text files in the same directory as the .editorconfig. Here is apple.txt:

awfewaef

Then pear.txt:

oijoij

Steps

  1. vim apple.txt (The text in apple.txt is highlighted correctly as expected)
  2. Then in vim, call vsplit pear.txt (The text in pear.txt is highlighted, but the text in apple.txt is no longer highlighted). When you try to switch back to apple.txt and press z=, it says Spell checking is not possible).
alkim0 commented 2 years ago

This seems to be a fundamental issue with vim setting encodings: https://github.com/vim/vim/issues/10876

alkim0 commented 2 years ago

It seems this behavior is intended and setting "encoding" should be avoided after startup if possible.

cxw42 commented 2 years ago

This should be fixed with the merge of #186 --- please reopen if that is not the case! Thanks!