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
|
while l:pos > 0
|
||||||
if l:line[l:pos - 1] =~# '{\|,\|\['
|
if l:line[l:pos - 1] =~# '{\|,\|\['
|
||||||
\ || l:line[l:pos-2:l:pos-1] ==# ', '
|
\ || l:line[l:pos-2:l:pos-1] ==# ', '
|
||||||
|
let s:completer.context = matchstr(l:line, '\S*$')
|
||||||
return l:pos
|
return l:pos
|
||||||
else
|
else
|
||||||
let l:pos -= 1
|
let l:pos -= 1
|
||||||
@ -256,6 +257,14 @@ function! s:ref.complete(regex) dict " {{{2
|
|||||||
\ })
|
\ })
|
||||||
endfor
|
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
|
return self.candidates
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user