Fix: retrocompatibility and Vint

This commit is contained in:
Tinmarino 2020-05-13 11:34:02 -04:00
parent d86685f350
commit 0850ce13ad
2 changed files with 6 additions and 4 deletions

View File

@ -2143,9 +2143,9 @@ endfunction
function! vimwiki#base#is_diary_file(filename, ...) abort function! vimwiki#base#is_diary_file(filename, ...) abort
let l:diary_file_paths = a:0 > 0 ? a:1 : vimwiki#diary#get_diary_files() let l:diary_file_paths = a:0 > 0 ? a:1 : vimwiki#diary#get_diary_files()
let l:normalised_file_paths = let l:normalised_file_paths =
\ map(l:diary_file_paths, {_, path -> vimwiki#path#normalize(path)}) \ map(l:diary_file_paths, 'vimwiki#path#normalize(v:val)')
let l:matching_files = let l:matching_files =
\ filter(l:normalised_file_paths, {index, file -> file =~# a:filename}) \ filter(l:normalised_file_paths, 'v:val =~# a:filename')
return len(l:matching_files) > 0 " filename is a diary file if match is found return len(l:matching_files) > 0 " filename is a diary file if match is found
endfunction endfunction

View File

@ -112,7 +112,7 @@ endfunction
" Sets the filetype to vimwiki " Sets the filetype to vimwiki
" If g:vimwiki_filetypes variable is set " If g:vimwiki_filetypes variable is set
" the filetype will be vimwiki.<ft1>.<ft2> etc. " the filetype will be vimwiki.<ft1>.<ft2> etc.
function! vimwiki#u#ft_set() function! vimwiki#u#ft_set() abort
let ftypelist = vimwiki#vars#get_global('filetypes') let ftypelist = vimwiki#vars#get_global('filetypes')
let ftype = 'vimwiki' let ftype = 'vimwiki'
for ftypeadd in ftypelist for ftypeadd in ftypelist
@ -125,7 +125,9 @@ endfunction
" If multiple fileytpes are in use 1 is returned only if the " If multiple fileytpes are in use 1 is returned only if the
" first ft is vimwiki which should always be the case unless " first ft is vimwiki which should always be the case unless
" the user manually changes it to something else " the user manually changes it to something else
function! vimwiki#u#ft_is_vw() function! vimwiki#u#ft_is_vw() abort
" Clause: is filetype defined
if &filetype ==# '' | return 0 | endif
if split(&filetype, '\.')[0] ==? 'vimwiki' if split(&filetype, '\.')[0] ==? 'vimwiki'
return 1 return 1
else else