Skip to content

Delete the name-duplicating buffer before ceating a gist file buffer #229

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Delete the name-duplicating buffer before ceating a gist file buffer
If repeatly opening a same file on the vim-gist, vim-gist gives
the new buffer the same name  as previous buffer, without deleting
the opened buffer first. Then a `file E95` exception is thrown,
and vim-gist will echo error message `Gist contains binary`.

Probably corressponding issue report:
#220
  • Loading branch information
iiifr committed Aug 24, 2020
commit 7f221867a0305ec92c76fe38e6d5f2c08814937b
1 change: 1 addition & 0 deletions autoload/gist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ function! s:GistGet(gistid, clipboard) abort
endif
endif
setlocal noswapfile
silent! exec 'bdel' s:bufprefix.a:gistid.'/'.fnameescape(filename)
silent exec 'noautocmd file' s:bufprefix.a:gistid.'/'.fnameescape(filename)
endif
set undolevels=-1
Expand Down