lambdalisue / vim-gina

👣 Asynchronously control git repositories in Neovim/Vim 8
http://www.vim.org/scripts/script.php?script_id=5531
MIT License
688 stars 27 forks source link

Correct way to close blame windows #89

Closed itchyny closed 7 years ago

itchyny commented 7 years ago

After I open a blame window, using :quit leaves gina://.files:show/XX buffer in the buffer list (:ls). This is a serious problem because closing the normal file buffer gives back to the file:show buffer without the blame window on the left. So the question is, which command is the best way to close the both blame windows.

lambdalisue commented 7 years ago

See https://github.com/lambdalisue/gina.vim/pull/79 and please write your opinion 👍

itchyny commented 7 years ago

Thanks, I'll take a look into that issue.

lambdalisue commented 7 years ago

:Gina blame : use :Gina show : internally to open a content of the file on the commit.

While https://github.com/lambdalisue/gina.vim/blob/HEAD/autoload/gina/command/show.vim#L65, the buffer will be hidden instead if you are using set hidden.

So do you think the buffer of :Gina show : should always setlocal bufhidden=wipe or any alternative idea?

itchyny commented 7 years ago

Yeah, that would be nice.

lambdalisue commented 7 years ago

Hum... Could you explain a bit more about the reason you think the current behavior is critical?

While :Gina show : opens a file like buffer, setlocal bufhidden& is a proper behavior I think. For example, if setlocal bufhidden=wipe is used, users cannot use <C-^> to get back to the buffer.

itchyny commented 7 years ago

I'm talking of blame windows. On closing gina-blame buffer, we don't need file-show buffer anymore. For example 1. open some file 2. :Gina blame : 3. :q 4. :bd brings back to the gina://**:show/ buffer, which is not unintentional.

marcusbuffett commented 7 years ago

Just throwing in my 2 cents, I'd also like if it could behave as @itchyny is describing.

bimlas commented 7 years ago

I cannot reproduce the issue (on Vim 8.0.0587 x86, Windows 7 x64). To be clear:

1. Open README.md of Gina with minimal .vimrc

set nocompatible
filetype plugin indent on
syntax enable
set runtimepath+=$HOME/.vim/plugins/gina.vim

Output of :ls:

  1 %a   ".\README.md"                  line 1

2. Gina blame :

Output of :ls:

  1      ".\README.md"                  line 1
  2 #a-  "gina://gina.vim:show/:README.md" line 0

3. Switch to gina://gina.vim:show/:README.md window, press :q

Output of :ls:

  1 %a   ".\README.md"                  line 1

4. :bd on navigation window

Output of :ls:

  1 %a   ".\README.md"                  line 1

Closing navi instead of gina://gina.vim:show/:README.md

3. Stay in navigation window, press :q

Output of :ls:

  1      ".\README.md"                  line 1
  2 %a-  "gina://gina.vim:show/:README.md" line 0

4. :bd on gina://gina.vim:show/:README.md

Output of :ls:

  1 %a   ".\README.md"                  line 1

For me it allways wipes out the blame-related buffers.

lambdalisue commented 7 years ago

Thanks for the investigation. Well, this issue exists on users who use set hidden globally I think.