Skip to content

Removes unnecessary bang on Bclose command#20

Open
michael-wojcik wants to merge 1 commit intoiberianpig:masterfrom
michael-wojcik:master
Open

Removes unnecessary bang on Bclose command#20
michael-wojcik wants to merge 1 commit intoiberianpig:masterfrom
michael-wojcik:master

Conversation

@michael-wojcik
Copy link
Copy Markdown

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
Copy Markdown
Owner

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

Comment thread autoload/tig_explorer.vim
if a:exit_code == 0
if has('nvim')
silent! Bclose!
silent! Bclose
Copy link
Copy Markdown
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
Copy Markdown
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! #

Comment thread autoload/tig_explorer.vim
if a:exit_code == 0
if has('nvim')
silent! Bclose!
silent! Bclose
Copy link
Copy Markdown
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