qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.68k stars 219 forks source link

Changed files are not reloaded #242

Open romaninsh opened 8 years ago

romaninsh commented 8 years ago

Most editors would reload unmodified buffers if they have been changed by other application, while VimR does not.

felipesere commented 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"

romaninsh commented 8 years ago

reloading is just consistent with others editors.

qvacua commented 8 years ago

I think that it'd be the best when we'd rely on NeoVim's behavior here.

romaninsh commented 8 years ago

possibly can be solved with

set autoread

in init. Testing...

alexbepple commented 7 years ago

@romaninsh "set autoread" used to work in old pre-NeoVim VimR. It does not anymore. Does anybody have a clue as to why?

qvacua commented 7 years ago

Hm... I don't know why. Does it work with Neovim on the terminal?

romaninsh commented 7 years ago

neovim, vim, vimr are not detecting the change. Here is screenshot of "MacVim" who is the only one that spotted the change:

screen shot 2017-02-13 at 15 09 45

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.

nhtzr commented 7 years ago

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!

ravicious commented 6 years ago

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.