11" Vim auto-load script
22" Author: Peter Odding <peter@peterodding.com>
3- " Last Change: December 10 , 2011
3+ " Last Change: December 11 , 2011
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.16.14 '
9+ let g: xolox #notes#version = ' 0.16.15 '
1010let s: scriptdir = expand (' <sfile>:p:h' )
1111
1212function ! xolox#notes#init () " {{{1
@@ -541,7 +541,7 @@ function! xolox#notes#swaphack() " {{{2
541541 endif
542542endfunction
543543
544- function ! xolox#notes#autocmd_pattern (directory ) " {{{2
544+ function ! xolox#notes#autocmd_pattern (directory , use_extension ) " {{{2
545545 " Generate a normalized automatic command pattern. First we resolve the path
546546 " to the directory with notes (eliminating any symbolic links) so that the
547547 " automatic command also applies to symbolic links pointing to notes (Vim
@@ -556,6 +556,9 @@ function! xolox#notes#autocmd_pattern(directory) " {{{2
556556 endif
557557 " Escape the directory but not the trailing "*".
558558 let pattern = fnameescape (directory ) . ' /*'
559+ if a: use_extension && ! empty (g: notes_suffix )
560+ let pattern .= g: notes_suffix
561+ endif
559562 " On Windows the pattern won't match if it contains repeating slashes.
560563 return substitute (pattern, ' /\+' , ' /' , ' g' )
561564endfunction
0 commit comments