Skip to content

Commit 7f22186

Browse files
committed
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: mattn#220
1 parent 2158ece commit 7f22186

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

autoload/gist.vim

+1
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ function! s:GistGet(gistid, clipboard) abort
450450
endif
451451
endif
452452
setlocal noswapfile
453+
silent! exec 'bdel' s:bufprefix.a:gistid.'/'.fnameescape(filename)
453454
silent exec 'noautocmd file' s:bufprefix.a:gistid.'/'.fnameescape(filename)
454455
endif
455456
set undolevels=-1

0 commit comments

Comments
 (0)