Merge remote-tracking branch 'upstream/dev' into upstream/tags

Conflicts:
	doc/vimwiki.txt
This commit is contained in:
Ivan Tishchenko
2015-05-06 17:27:25 +04:00
5 changed files with 121 additions and 88 deletions

View File

@ -270,7 +270,6 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
\ 'scheme': '',
\ 'filename': '',
\ 'anchor': '',
\ 'relative': 0,
\ }
@ -303,12 +302,14 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
" check if absolute or relative path
if is_wiki_link && link_text[0] == '/'
let link_text = link_text[1:]
let link_infos.relative = 0
if link_text != '/'
let link_text = link_text[1:]
endif
let is_relative = 0
elseif !is_wiki_link && vimwiki#path#is_absolute(link_text)
let link_infos.relative = 0
let is_relative = 0
else
let link_infos.relative = 1
let is_relative = 1
let root_dir = fnamemodify(source_file, ':p:h') . '/'
endif
@ -321,7 +322,7 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
return link_infos
endif
if !link_infos.relative || link_infos.index != source_wiki
if !is_relative || link_infos.index != source_wiki
let root_dir = VimwikiGet('path', link_infos.index)
endif
@ -345,7 +346,7 @@ function! vimwiki#base#resolve_link(link_text, ...) "{{{
\ link_text .
\ VimwikiGet('ext', link_infos.index)
elseif (link_infos.scheme ==# 'file' || link_infos.scheme ==# 'local')
\ && link_infos.relative
\ && is_relative
let link_infos.filename = simplify(root_dir . link_text)
else " absolute file link
" collapse repeated leading "/"'s within a link
@ -590,10 +591,10 @@ function! vimwiki#base#get_wiki_directories(wiki_nr)
endif
let result = ['./']
for wikidir in dirs
let wikidir_relative = vimwiki#path#relpath(cwd, wikidir).'/'
let wikidir_relative = vimwiki#path#relpath(cwd, wikidir)
call add(result, wikidir_relative)
if a:wiki_nr == g:vimwiki_current_idx
let wikidir_absolute = '/'.vimwiki#path#relpath(root_dir, wikidir).'/'
let wikidir_absolute = '/'.vimwiki#path#relpath(root_dir, wikidir)
call add(result, wikidir_absolute)
endif
endfor