Swapfiles are ignored when this plugin is installed
This bug is specific to the vim-polyglot instance.
Describe the bug: When editing files, if the editor crashes or is accidentally closed, swap files are configured by this plugin to be in an unretrievable location, and no prompt is shown warning the user of an existing swap file or any options to recover.
To Reproduce:
$ touch test.txt
$ vim test.txt
# Edit File
# Save File
# Edit File again
# Close window without saving
# Open new terminal window
# vim test.txt
Expected behavior: a prompt appears warning the user that an existing swap file has been found. This allows one to recover lost work from the file exiting without saving properly. It also protects the user from two windows editing the same file at the same time.
This is caused by the vim-polyglot/autoload/polyglot/init.vim file lines 2712 through 2730.
I see that this is described as a feature in the readme:
Automatically reload file if changed somewhere else Disable existing swapfile warnings, instead just create multiple swapfiles Don't create swapfiles in current directory, instead in data directory
I assume autoreload is meant to autorecover the swapfile? However this is not the behavior I experience. When performing the steps above, test.txt is opened with no warning that an existing .swp files exists, and the most recent edits that were lost to closing the window are not recovered.
+1, seeing the same behaviour, and it took me a while to narrow it down to this plugin.
For anyone else using packer.nvim and hitting this, workaround is:
use {'sheerun/vim-polyglot', config = 'vim.opt.shortmess:remove("A")'} -- Syntax files for a large number of different languages + workaround for https://github.com/sheerun/vim-polyglot/issues/765.
(for other vim package managers, you want the "run a command after plugin loading", and the vimscript equivalent is:
set shortmess-=A