Open romaninsh opened 8 years ago
Should it just emit a warning and let the user choose to reload or ignore? I've been saved a bunch of times by the fact that I still had a file in a buffer "in a good state"
reloading is just consistent with others editors.
I think that it'd be the best when we'd rely on NeoVim's behavior here.
possibly can be solved with
set autoread
in init. Testing...
@romaninsh "set autoread" used to work in old pre-NeoVim VimR. It does not anymore. Does anybody have a clue as to why?
Hm... I don't know why. Does it work with Neovim on the terminal?
neovim, vim, vimr are not detecting the change. Here is screenshot of "MacVim" who is the only one that spotted the change:
The reason I think this needs to be done is because that's a normal behaviour of native Mac application - to reload un-edited file if it was modified externally or ask user what to do otherwise.
Hi, sorry for resurrecting this!
I just wanted to mention that this warning in the screenshot is created by the :checktime
ex command.
For some reason it's not configured as an autocommand in neovim, but you can configure it by adding this to your init.vim :
au FocusGained * checktime
As an extra, I also like to set noautoread
because I actually like having this warning message appear even if I haven't made any changes in the buffer.
I've tested this using nvim in iterm2 btw. I hope it thelps!
By the way, looking at @romaninsh's screenshot: is the "Load all" a feature of macvim/gvim? I remember that when files changed outside of the editor, they both offered to reload all changed buffers. I used @nhtzr's solution and it works, but it asks me about each file separately without an option to either ignore or reload all.
Most editors would reload unmodified buffers if they have been changed by other application, while VimR does not.