Skip to content

Commit 7a500ba

Browse files
committed
Bug fix for issue #77: Error when deleting note when there are no buffers
1 parent e900224 commit 7a500ba

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

autoload/xolox/notes.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 7, 2014
3+
" Last Change: August 4, 2014
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.26'
9+
let g:xolox#notes#version = '0.26.1'
1010
let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
1111
let s:scriptdir = expand('<sfile>:p:h')
1212

@@ -438,7 +438,10 @@ function! xolox#notes#delete(bang, title) " {{{1
438438
call xolox#misc#msg#warn("notes.vim %s: Failed to delete %s!", g:xolox#notes#version, filename)
439439
else
440440
call xolox#notes#cache_del(filename)
441-
execute 'bdelete' . a:bang . ' ' . bufnr(filename)
441+
let buffer_number = bufnr(filename)
442+
if buffer_number >= 0
443+
execute 'bdelete' . a:bang . ' ' . buffer_number
444+
endif
442445
endif
443446
endif
444447
endfunction

0 commit comments

Comments
 (0)