chrisbra / Recover.vim

A Plugin to show a diff, whenever recovering a buffer
http://www.vim.org/scripts/script.php?script_id=3068
248 stars 25 forks source link

no messages shown and file opens #66

Closed wis closed 3 years ago

wis commented 4 years ago

Hey, thank you for creating this immensely useful plugin :smiley:

I just noticed that the message stopped showing even though I have the file opened in an other vim process.

I tried to isolate the issue, so here's what I've done:

call plug#begin('~/.vim/plugged') Plug 'chrisbra/Recover.vim' call plug#end()



nvim: NVIM v0.4.3
/usr/bin/vim: `VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan  7 2020 22:53:41)
Included patches: 1-100
Compiled by Arch Linux`
platform:  `Linux archiver 5.4.12-arch1-1 #1 SMP PREEMPT Tue, 14 Jan 2020 21:44:31 +0000 x86_64 GNU/Linux`
chrisbra commented 4 years ago

does the other vim instance write a swap file?

chrisbra commented 4 years ago

btw, does resetting the shortmess option change anything?

wis commented 4 years ago

does the other vim instance write a swap file?

yes, the first instance creates it

btw, does resetting the shortmess option change anything?

no, I appended set shortmess= to my init.vim and tried again, same thing happens, a swap file get created first time I open file, and a second time when it doesn't warn and shows content after a barely noticeable pause.

chrisbra commented 4 years ago

yes, the first instance creates it

In the same location?

So does this only happen in Neovim or also in Vim.

selurvedu commented 4 years ago

Same problem here on Neovim 0.4.3.

In the same location?

By default Neovim stores all swap files in the ~/.local/share/nvim/swap/ dir.

tejasvi commented 3 years ago

@selurvedu That explains! For all this time I was oblivious of the notes I am losing until today when I had to go through the old ones. @chrisbra You might want to add the warning for neovim users. Also, any other similar plugins meanwhile?

chrisbra commented 3 years ago

Hm, so let me summarize:

1) You open the file in Vim, do some changes and Vim creates the swapfile as usual in the current directory. 2) You open the same file in Neovim, but you do not get the warning message with the compare prompt.

That is, because Neovim creates the swapfile ~/.local/share/nvim/swap/ and does not care about the swapfile in the current directory?. Is this right?

I can add a message in the documentation, not sure this will help much. I guess it makes sense, to configure both Vim and Neovim to use the same directory for swap files, so correctly setting the 'dir' option.