Fix a few regexes

Without this, things would go wrong if the user has >= 10 Wikis.
This commit is contained in:
EinfachToll 2018-11-05 22:36:25 +01:00
parent 90722a4703
commit 675ff23ed1
1 changed files with 4 additions and 4 deletions

View File

@ -63,13 +63,13 @@ function! Complete_wikifiles(findstart, base)
elseif a:base !~# '#'
" we look for wiki files
if a:base =~# '^wiki\d:'
let wikinumber = eval(matchstr(a:base, '^wiki\zs\d'))
if a:base =~# '\m^wiki\d\+:'
let wikinumber = eval(matchstr(a:base, '\m^wiki\zs\d\+'))
if wikinumber >= vimwiki#vars#number_of_wikis()
return []
endif
let prefix = matchstr(a:base, '^wiki\d:\zs.*')
let scheme = matchstr(a:base, '^wiki\d:\ze')
let prefix = matchstr(a:base, '\m^wiki\d\+:\zs.*')
let scheme = matchstr(a:base, '\m^wiki\d\+:\ze')
elseif a:base =~# '^diary:'
let wikinumber = -1
let prefix = matchstr(a:base, '^diary:\zs.*')