Shougo / defx.nvim

:file_folder: The dark powered file explorer implementation for neovim/Vim8
MIT License
1.17k stars 86 forks source link

Renaming errors due to E768 (swap file exists) #284

Closed resolritter closed 3 years ago

resolritter commented 3 years ago

Problems summary

  File "/home/user/res/vimplugins/defx.nvim/rplugin/python3/defx/kind/file.py", line 657, in _rename
    view._vim.call('defx#util#buffer_rename',
pynvim.api.common.NvimError: Vim(saveas):E768: Swap file exists: /home/user/.cache/vim/swap/index.js.swp (:silent! overrides)

The line in question

https://github.com/Shougo/defx.nvim/blob/026e489a1aebbdb0ee4823a68a9ba5324f6f1d12/autoload/defx/util.vim#L363

As seen by the file name, this happened when I was editing a JavaScript file when this error happened (it's common for files in different directories might have the name index.js at the same time).

Environment Information

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

I was not able to reproduce it manually, but it happens occasionally