Minor update to image file completion (#308)
This commit is contained in:
parent
d660b0ae42
commit
06a5b958f8
@ -325,11 +325,14 @@ function! s:img.complete(regex) dict " {{{2
|
|||||||
let l:output = b:vimtex.out()
|
let l:output = b:vimtex.out()
|
||||||
call filter(l:candidates, 'v:val !=# l:output')
|
call filter(l:candidates, 'v:val !=# l:output')
|
||||||
|
|
||||||
|
call map(l:candidates, 'strpart(v:val, len(b:vimtex.root)+1)')
|
||||||
|
|
||||||
if g:vimtex_complete_img_use_tail
|
if g:vimtex_complete_img_use_tail
|
||||||
return uniq(sort(map(l:candidates, 'fnamemodify(v:val, '':t'')')))
|
call map(l:candidates,
|
||||||
else
|
\ '{ ''abbr'' : v:val, ''word'' : fnamemodify(v:val, '':t'') }')
|
||||||
return map(l:candidates, 'strpart(v:val, len(b:vimtex.root)+1)')
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
return l:candidates
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
Loading…
Reference in New Issue
Block a user