Fixed TOC closest index issue
This commit is contained in:
parent
32d7361621
commit
8da3c4e536
@ -34,16 +34,15 @@ function! latex#toc#open()
|
|||||||
let b:toc_numbers = 1
|
let b:toc_numbers = 1
|
||||||
let b:calling_win = bufwinnr(calling_buf)
|
let b:calling_win = bufwinnr(calling_buf)
|
||||||
|
|
||||||
" Add TOC entries (keep track of closest index)
|
" Add TOC entries (and keep track of closest index)
|
||||||
let index = 0
|
let index = 0
|
||||||
let closest_index = 0
|
let closest_index = 0
|
||||||
for entry in toc
|
for entry in toc
|
||||||
call append('$', entry.number . "\t" . entry.title)
|
call append('$', entry.number . "\t" . entry.title)
|
||||||
|
|
||||||
let index += 1
|
let index += 1
|
||||||
if closest_index == 0
|
if entry.file == calling_file && entry.line <= calling_line
|
||||||
if calling_file == entry.file && calling_line > entry.line
|
let closest_index = index
|
||||||
let closest_index = index
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user