Fix: get_wikilinks arguments: add pattern
This commit is contained in:
parent
1eb74dcf2f
commit
36fa81c059
@ -529,6 +529,7 @@ endfunction
|
|||||||
" files in the given wiki.
|
" files in the given wiki.
|
||||||
" If the given wiki number is negative, the diary of the current wiki is used.
|
" If the given wiki number is negative, the diary of the current wiki is used.
|
||||||
" If also_absolute_links is nonzero, also return links of the form /file
|
" If also_absolute_links is nonzero, also return links of the form /file
|
||||||
|
" If pattern is not '', only filepaths matching pattern will be considered
|
||||||
function! vimwiki#base#get_wikilinks(wiki_nr, also_absolute_links, pattern) abort
|
function! vimwiki#base#get_wikilinks(wiki_nr, also_absolute_links, pattern) abort
|
||||||
let files = vimwiki#base#find_files(a:wiki_nr, 0, a:pattern)
|
let files = vimwiki#base#find_files(a:wiki_nr, 0, a:pattern)
|
||||||
if a:wiki_nr == vimwiki#vars#get_bufferlocal('wiki_nr')
|
if a:wiki_nr == vimwiki#vars#get_bufferlocal('wiki_nr')
|
||||||
|
@ -917,7 +917,7 @@ function! vimwiki#vars#get_bufferlocal(key, ...) abort
|
|||||||
call setbufvar(buffer, 'vimwiki_invsubdir', vimwiki#base#invsubdir(subdir))
|
call setbufvar(buffer, 'vimwiki_invsubdir', vimwiki#base#invsubdir(subdir))
|
||||||
elseif a:key ==# 'existing_wikifiles'
|
elseif a:key ==# 'existing_wikifiles'
|
||||||
call setbufvar(buffer, 'vimwiki_existing_wikifiles',
|
call setbufvar(buffer, 'vimwiki_existing_wikifiles',
|
||||||
\ vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 1))
|
\ vimwiki#base#get_wikilinks(vimwiki#vars#get_bufferlocal('wiki_nr'), 1, ''))
|
||||||
elseif a:key ==# 'existing_wikidirs'
|
elseif a:key ==# 'existing_wikidirs'
|
||||||
call setbufvar(buffer, 'vimwiki_existing_wikidirs',
|
call setbufvar(buffer, 'vimwiki_existing_wikidirs',
|
||||||
\ vimwiki#base#get_wiki_directories(vimwiki#vars#get_bufferlocal('wiki_nr')))
|
\ vimwiki#base#get_wiki_directories(vimwiki#vars#get_bufferlocal('wiki_nr')))
|
||||||
|
@ -80,7 +80,7 @@ function! Complete_wikifiles(findstart, base) abort
|
|||||||
let scheme = ''
|
let scheme = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let links = vimwiki#base#get_wikilinks(wikinumber, 1)
|
let links = vimwiki#base#get_wikilinks(wikinumber, 1, '')
|
||||||
let result = []
|
let result = []
|
||||||
for wikifile in links
|
for wikifile in links
|
||||||
if wikifile =~ '^'.vimwiki#u#escape(prefix)
|
if wikifile =~ '^'.vimwiki#u#escape(prefix)
|
||||||
|
@ -82,7 +82,7 @@ function! s:setup_new_wiki_buffer() abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if vimwiki#vars#get_wikilocal('maxhi')
|
if vimwiki#vars#get_wikilocal('maxhi')
|
||||||
call vimwiki#vars#set_bufferlocal('existing_wikifiles', vimwiki#base#get_wikilinks(wiki_nr, 1))
|
call vimwiki#vars#set_bufferlocal('existing_wikifiles', vimwiki#base#get_wikilinks(wiki_nr, 1, ''))
|
||||||
call vimwiki#vars#set_bufferlocal('existing_wikidirs',
|
call vimwiki#vars#set_bufferlocal('existing_wikidirs',
|
||||||
\ vimwiki#base#get_wiki_directories(wiki_nr))
|
\ vimwiki#base#get_wiki_directories(wiki_nr))
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user