-
Notifications
You must be signed in to change notification settings - Fork 66
origin_lnum in context dictionary not working #183
Copy link
Copy link
Closed
Description
Description
The context dictionary for the templates functionality returns 1 for origin_lnum .
Expected behaviour:
In my template, for a given case, {origin_lnum} is expected to return 146, as the wiki link is at line 146. However it returns 1.
Looking at the context dictionary and the function wiki#nav/get_previous() I don't see how it could return anything else than 1:
autoload/wiki/template.vim:
let l:origin = wiki#nav#get_previous()
let l:context = {
...
\ 'origin_lnum': l:origin[1][1],
...
\}
autoload/wiki/nav.vim:
function! wiki#nav#get_previous() abort "{{{1
let l:previous = get(s:position_stack, -1, [])
if !empty(l:previous) | return l:previous | endif
let l:file = expand('#:p')
let l:pos = [0, 1, 1, 0, 1] <------ Namely this line
if filereadable(l:file) | return [l:file, l:pos] | endif
return ['', l:pos]
endfunction
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels