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