Fix #503: Handle \eqref as \ref{eq:
This commit is contained in:
parent
d2d8115e39
commit
930659bc5e
@ -50,6 +50,7 @@ function! vimtex#complete#omnifunc(findstart, base) " {{{1
|
||||
while l:pos > 0
|
||||
if l:line[l:pos - 1] =~# '{\|,\|\['
|
||||
\ || l:line[l:pos-2:l:pos-1] ==# ', '
|
||||
let s:completer.context = matchstr(l:line, '\S*$')
|
||||
return l:pos
|
||||
else
|
||||
let l:pos -= 1
|
||||
@ -256,6 +257,14 @@ function! s:ref.complete(regex) dict " {{{2
|
||||
\ })
|
||||
endfor
|
||||
|
||||
"
|
||||
" If context is 'eqref', then only show eq: labels
|
||||
"
|
||||
if self.context =~# '\\eqref'
|
||||
\ && !empty(filter(copy(self.matches), 'v:val[0] =~# ''eq:'''))
|
||||
call filter(self.candidates, 'v:val.word =~# ''eq:''')
|
||||
endif
|
||||
|
||||
return self.candidates
|
||||
endfunction
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user