Repeated file modification warning on invoking :Rg!
- Dominant language
- Vim Script
- Stars
- 10.3k
- Forks
- 608
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 2
Description
- [x] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
- [x] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
- [x] I have read through the manual page of fzf (`man fzf`)
- [x] I have searched through the existing issues
# Steps taken
1. `:Rg! some-pattern`
# Expected result
A full-screen fzf window opens, listing files that contain the pattern at the top and a preview at the bottom.
# Observed result
This is a weird one!
First, I get the "WARNING: The file has been changed since reading it!!!" prompt. Choosing "no" takes me to a blank screen that just says "Press ENTER or type command to continue". Pressing Enter gives me the "file has been changed" prompt again, this time on an otherwise blank screen. Answering "no" again finally opens the fzf window I expect. Selecting a file here shows me an otherwise blank screen that says:
> Press ENTER or type command to continue
> [No write since last change]
>
> Press ENTER or type command to continue
Pressing Enter finally opens the file I selected. If I press CtrlC instead, I get this:
> Press ENTER or type command to continue
> [No write since last change]
>
> shell returned 130
>
> Press ENTER or type command to continue
Choosing "yes" at the first "file has been changed" prompt finally made the bug stop happening. I can no longer recreate it.
One thing I did notice: during this whole process, a background buffer (in my `:Buffers` list) had the `[+]` pattern next to it, indicating that there were unsaved changes in that buffer. After I chose "yes" at the first "file has been changed" prompt, the `[+]` went away, so I'm assuming that's the file that got saved. However, simply going and adding unsaved changes to a background buffer doesn't make the bug reappear.
I'm now also noticing this: if I add unsaved changes to a buffer, and then invoke `:Rg!`, those changes get saved.
# Reproduction
I couldn't reproduce this with a minimal config. What I do have is a Vim session file (generated by Obsession); I can share it in case it's helpful. Sourcing that file in a new Vim instance doesn't help me reproduce it either.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.