Skip to content

Commit 64ae76b

Browse files
committed
don't use obsolete/deprecated last_buffer_nr
it was replaced by bufnr("$") also use bufexists (first) as this is the simplest way to know if a buffer exists
1 parent fd18e27 commit 64ae76b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/gist.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ function! s:GistPost(user, token, content, private)
580580
endfunction
581581

582582
function! s:GistPostBuffers(user, token, private)
583-
let bufnrs = range(1, last_buffer_nr())
583+
let bufnrs = range(1, bufnr("$"))
584584
let bn = bufnr('%')
585585
let query = []
586586
if len(a:user) > 0 && len(a:token) > 0
@@ -605,7 +605,7 @@ function! s:GistPostBuffers(user, token, private)
605605

606606
let index = 1
607607
for bufnr in bufnrs
608-
if buflisted(bufnr) == 0 || bufwinnr(bufnr) == -1
608+
if !bufexists(bufnr) || buflisted(bufnr) == 0
609609
continue
610610
endif
611611
echo "Creating gist content".index."... "

0 commit comments

Comments
 (0)