vim-fugitive icon indicating copy to clipboard operation
vim-fugitive copied to clipboard

:Gedit and similar commands spawn non-persistent buffers

Open hood opened this issue 1 year ago • 1 comments

Every time I try to open a past revision of a file, with something like:

:Gedit HEAD~4:%

A new buffer is open with -following this example- the current file at the indicated revision as expected, but as soon as I navigate away from that buffer, it vanishes. The only way for me to get back to it is by navigating to it using the jumplist, but it’s not persisted as the content of a buffer.

https://github.com/tpope/vim-fugitive/assets/56588510/6dcea009-00bf-4bf4-8651-c87e774a3026

As the video shows, I’m opening a previous revision of the file I’m currently working on, then moving to the tab to the left, making the newly opened buffer disappear.

hood avatar Apr 25 '24 08:04 hood

UPDATE: probably solved this by setting

autocmd User FugitiveObject setlocal bufhidden=

hood avatar Apr 25 '24 09:04 hood

The reason it defaults to bufhidden=delete is that multiple people complained about the default behavior. Sounded like a personal problem to me, but ultimately, I gave the people what they wanted.

tpope avatar May 10 '24 15:05 tpope