One9398 / vimwiki

Automatically exported from code.google.com/p/vimwiki
0 stars 1 forks source link

wiki using markdown defined after wiki using default syntax cannot follow link normally #403

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. config two wikis in .vimrc
    let g:vimwiki_list = [ 
        \ {'path': '~/vimwiki/', 'syntax': 'default', 'ext': '.wiki'}, 
        \ {'path': '~/vimwiki/research/', 'syntax': 'markdown', 'ext': '.md'}, 
        \ ]

2. open vim, use 2<Leader>ww to the 2nd wiki, create someting, then <CR> to 
make it a wiki link, <CR> again to follow it
3. you will get the error, as follow
Error detected while processing function vimwiki#base#follow_link..vimwik
i#markdown_base#follow_link..vimwiki#markdown_base#open_reflink..vimwiki#
markdown_base#get_reflinks..vimwiki#markdown_base#scan_reflinks:
line    4:
E121: Undefined variable: g:vimwiki_rxMkdRef
E15: Invalid expression: 'vimgrep #'.g:vimwiki_rxMkdRef.'#j %'
Error detected while processing function vimwiki#base#follow_link..vimwik
i#markdown_base#follow_link..vimwiki#markdown_base#open_reflink..vimwiki#
markdown_base#get_reflinks:
line   11:
E171: Missing :endif
Error detected while processing function vimwiki#base#follow_link..vimwik
i#markdown_base#follow_link:
line   36:
E171: Missing :endif
Error detected while processing function vimwiki#base#follow_link:
line   10:
E171: Missing :endif

What version of the product are you using? On what operating system?
vim 7.3.798, vimwiki latest(installed from github.com/vim-scripts/vimwiki), on 
archlinux (latest, 2013-03-07)

Please provide any additional information below.
but if I switch the order of the two wikis to 
    let g:vimwiki_list = [ 
        \ {'path': '~/vimwiki/research/', 'syntax': 'markdown', 'ext': '.md'}, 
        \ {'path': '~/vimwiki/', 'syntax': 'default', 'ext': '.wiki'}, 
        \ ]

then it works, nothing abnormal happens

Original issue reported on code.google.com by yuec...@gmail.com on 7 Mar 2013 at 8:04

GoogleCodeExporter commented 8 years ago
I figured it out, it's because the nesting of ~/vimwiki/research/ in ~/vimwiki/.

actually, by using the default syntax, you can create links like 
[[category/article]], it will resolve to the wiki link 
~/wimwiki/category/article. 

but it seems this feature isn't mentioned in the doc. perhaps it would be 
better if pointed out explicitly in the vimwiki doc. or maybe I'm just omitted 
it

Original comment by yuec...@gmail.com on 7 Mar 2013 at 9:09