antoinemadec / coc-fzf

fzf :heart: coc.nvim
390 stars 28 forks source link

"E37: No write since last change (add ! to override)" occurs when opening edited file #90

Closed rainzm closed 3 years ago

rainzm commented 3 years ago

Environment

Features: +acl +iconv +tui See ":help feature-compile"

 系统 vimrc 文件: "$VIM/sysinit.vim"
     $VIM 预设值: "/share/nvim"

Run :checkhealth for more info


# Describe the Bug
Use `CocFzfList diagnostics` or `<Plug>(coc-references)` to open FzfList window and select a file to open. If this file has been modified and not saved, "E37: No write since last change (add ! to override)" will occurs.

I noticed the modification in commit https://github.com/antoinemadec/coc-fzf/commit/94103981228454680736c2d728862ec4616cd3ac and `edit` a file that has been modified but not saved will have the above error.
I roll the commit above and the problem disappears.
# To Reproduce
## **Minimal** vimrc
```vim
" minimal vimrc

Steps to Reproduce

  1. CocFzfList diagnostics
  2. select a file that has been modified but not saved
  3. error occurs

Expected Behavior

no error

antoinemadec commented 3 years ago

@rainzm thanks a lot for reporting this issue. I will try to take a look at it in the next few days !