0

I've been noticing some rather confusing behavior in my neovim setup and I'm really not even sure if it's a problem, just a feature that surprised me.

I recently noticed that the classic "This file is already open" warning message hasn't been displaying when I open a file in multiple terminals. This concerned me at first, but I just did some testing and found the following behavior:

  1. Create a file (test.md).
  2. Open the file in a terminal.
  3. Open the file in a second terminal (No warning is shown)
  4. Edit the file in either terminal, :w, and click over to the other terminal.

Result => In the other terminal the content is automatically updated to reflect the previous changes.

So far as I can tell this isn't behavior that I've explicitly set (though my init.vim setup has grown rather large and spans multiple files). I grepped for 'swap' and the only hits I got were in Plug.

Is this new behavior in neovim or have I committed the mortal sin of installing a plugin and I don't know what it does?

Update: I found this explanation of how to set this sort of behavior and grepping revealed nothing being set.

Update: Actually this is highly undesirable behavior because unsaved changes don't get updated.

3
  • 1
    I would check :verbose set autoread? as a first guess
    – D. Ben Knoble
    Commented Aug 4, 2021 at 18:39
  • @D.BenKnoble That helped. It told me the last place to set it was in vim-polyglot, I uninstalled it, and it came back. Thanks!
    – mas
    Commented Aug 5, 2021 at 19:49
  • 1
    makes a good answer to me. Include the debugging tip^ if you will. Personally I don’t really recommend polyglot. It’s a bit too much for me and often has stuff that’s old or conflicts or whatever
    – D. Ben Knoble
    Commented Aug 5, 2021 at 19:57

1 Answer 1

1

The problem turned out to be in a plugin, vim-polyglot, which was setting autoread. Disabling that plugin solved the problem.

For future readers, solving this problem was as easy as running :verbose set autoread? which told me the last line in all of my configurations where it was set.

Thanks to D. Ben Knoble for the tip.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.