Skip to content

Commit

Permalink
don't use obsolete/deprecated last_buffer_nr
Browse files Browse the repository at this point in the history
it was replaced by bufnr("$")

also use bufexists (first) as this is the simplest way to know if a
buffer exists
  • Loading branch information
AD7six committed Apr 16, 2011
1 parent fd18e27 commit 64ae76b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/gist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ function! s:GistPost(user, token, content, private)
endfunction

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

let index = 1
for bufnr in bufnrs
if buflisted(bufnr) == 0 || bufwinnr(bufnr) == -1
if !bufexists(bufnr) || buflisted(bufnr) == 0
continue
endif
echo "Creating gist content".index."... "
Expand Down

0 comments on commit 64ae76b

Please sign in to comment.