Open lu-zero opened 5 years ago
let vim reload the file once it notices
Did you manually do this or some plugin did it automatically for you?
it is the normal behavior on mac
.editorconfig
file?Thanks!
macOS, 8.2
I'm also seeing this behaviour on Ubuntu.
Ubuntu: 20.04 Vim: vim-gtk3 2:8.1.2269-1ubuntu5.7
I have the following in ~/.vim/ftplugin/javascript.vim
setlocal shiftwidth=4
setlocal tabstop=4
In the root dir of my project, I have the following .editorconfig
:
root = true
[*.js]
indent_style=space
indent_size=2
.js
file and save it (indent settings picked up from .editorconfig
correctly at this point)git checkout -f
)W11: Warning: File "path/to/file.js" has changed since editing started See ":help W11" for more info. [O]K, (L)oad File:
.vimrc
, not the .editorconfig
:set sw? ts?
shiftwidth=4
tabstop=4
:e
, and the settings from .editorconfig
are picked up correctly again.@alext thanks! I can repro following your steps above.
I agree that .editorconfig
should override the ftplugins on reload, as it does on :e
.
It looks like this might be an issue in vim itself. In the reload case, FileType
is invoked twice, once after BufRead
. Since we hook BufRead
, the FileType
work (including ftplugins) overrides what we did in BufRead
. Logfile diff:
To re-create: set up the files as above, and do
$ rm log.txt ; gvim '-nN' '-i' 'NONE' -V100log.txt test.js
then pull out the relevant sections of the log for reload and :e
, and do
:g/Executing.*Autocommands\|s:UseConfig\|ftplugin.javascript.vim/p
to get the relevant events.
Any Vim-internals folks who might be willing to file the issue upstream? If not, I can do my best, but I haven't touched vim's internals at all.
I noticed that upon reloading a file the editorconfig overrides are lost.
To reproduce:
git checkout -f
from another terminalAlso: