Update coffee, html and latex

This commit is contained in:
Adam Stankiewicz
2013-09-30 12:03:06 +02:00
parent 04e6a8a73c
commit e9d8c39608
3 changed files with 41 additions and 20 deletions

View File

@@ -312,7 +312,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
if included != ''
" append the input TOX to `toc` and `fileindices`
let newaux = prefix . '/' . included
let newtex = fnamemodify(fnamemodify(newaux, ':t:r') . '.tex', ':p')
let newtex = fnamemodify(newaux, ':r') . '.tex'
call s:ReadTOC(newaux, newtex, toc, fileindices)
continue
endif
@@ -441,23 +441,26 @@ function! s:FindClosestSection(toc, fileindices)
endif
let imax = len(a:fileindices[file])
let imin = 0
while imin < imax - 1
let i = (imax + imin) / 2
let tocindex = a:fileindices[file][i]
let entry = a:toc[tocindex]
let titlestr = entry['text']
let titlestr = escape(titlestr, '\')
let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g')
let [lnum, cnum] = searchpos('\\' . entry['level'] . '\_\s*{' . titlestr . '}', 'nW')
if lnum
let imax = i
else
let imin = i
endif
endwhile
return a:fileindices[file][imin]
if imax > 0
let imin = 0
while imin < imax - 1
let i = (imax + imin) / 2
let tocindex = a:fileindices[file][i]
let entry = a:toc[tocindex]
let titlestr = entry['text']
let titlestr = escape(titlestr, '\')
let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g')
let [lnum, cnum] = searchpos('\\' . entry['level'] . '\_\s*{' . titlestr . '}', 'nW')
if lnum
let imax = i
else
let imin = i
endif
endwhile
return a:fileindices[file][imin]
else
return 0
endif
endfunction
let s:ConvBackPats = map([