Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes unnecessary bang on Bclose command #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michael-wojcik
Copy link

I'm using SpaceVim and ran into an error where it's custom close_term_buffer function would throw an error each time I attempted to edit a file from within tig-explorer.vim:

Error detected while processing function SpaceVim#mapping#close_term_buffer:
line   18:
E516: No buffers were deleted: bd! 8

This was being thrown because s:tig_callback adds a bang to the Bclose command on Line 140. AFAIK, adding a bang here seems unnecessary and can cause conflicts with other window/buffer managers like the example above. By removing the bang from that one line, I am able to edit files from tig-explorer.vim without any errors.

BTW, thanks very much for providing the tig-explorer.vim plugin! It's really great to have the option of using Tig inside Vim! 🙏

@iberianpig
Copy link
Owner

Thanks for creating pull request!
I'll check it works on NeoVim.

@@ -137,7 +137,7 @@ endfunction
function! s:tig_callback(exit_code) abort
if a:exit_code == 0
if has('nvim')
silent! Bclose!
silent! Bclose
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On NeoVim, Bclose remains read-only buffers after do tig_callback

:buffers
  3 %a   "autoload/tig_explorer.vim"    line 141
  4 #h-  "term://.//23306:TIGRC_USER=/tmp/nvimSwU80w/3 tig status" line 39

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On SpaceVim, could you work the following workaround instead of silent! Bclose!?

Suggested change
silent! Bclose
silent! buffer # | bwipeout! #

@@ -137,7 +137,7 @@ endfunction
function! s:tig_callback(exit_code) abort
if a:exit_code == 0
if has('nvim')
silent! Bclose!
silent! Bclose
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On SpaceVim, could you work the following workaround instead of silent! Bclose!?

Suggested change
silent! Bclose
silent! buffer # | bwipeout! #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants