make VimwikiCheckLinks also find nonexisting directories

Fix #120
This commit is contained in:
EinfachToll 2015-03-19 13:22:28 +01:00
parent d20e03d660
commit f823589076

View File

@ -879,6 +879,12 @@ function! vimwiki#base#check_links() "{{{
call add(errors, {'filename':wikifile, 'lnum':lnum, 'col':col, call add(errors, {'filename':wikifile, 'lnum':lnum, 'col':col,
\'text': "there is no such anchor: ".target_anchor}) \'text': "there is no such anchor: ".target_anchor})
endif endif
else
if target_file =~ '/$' " maybe it's a link to a directory
if !isdirectory(target_file)
call add(errors, {'filename':wikifile, 'lnum':lnum, 'col':col,
\'text': "there is no such directory: ".target_file})
endif
else else
if filereadable(target_file) " maybe it's a non-wiki file if filereadable(target_file) " maybe it's a non-wiki file
let anchors_of_files[target_file] = [] let anchors_of_files[target_file] = []
@ -887,6 +893,7 @@ function! vimwiki#base#check_links() "{{{
\'text': "there is no such file: ".target_file}) \'text': "there is no such file: ".target_file})
endif endif
endif endif
endif
endfor endfor
endfor endfor