From 7f221867a0305ec92c76fe38e6d5f2c08814937b Mon Sep 17 00:00:00 2001 From: Hsu ShanHung Date: Mon, 24 Aug 2020 18:10:46 +0800 Subject: [PATCH] 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: https://github.com/mattn/vim-gist/issues/220 --- autoload/gist.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/gist.vim b/autoload/gist.vim index 7f803c6..89eb28a 100644 --- a/autoload/gist.vim +++ b/autoload/gist.vim @@ -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