Skip to content

Commit

Permalink
feat(qf): expand bst file paths
Browse files Browse the repository at this point in the history
refer: #2953
  • Loading branch information
lervag committed May 10, 2024
1 parent 641295a commit 97901b6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions autoload/vimtex/qf/bibtex.vim
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,21 @@ function! s:type_no_bibstyle.fix(ctx, entry) abort " {{{1
endfunction

" }}}1

let s:type_fix_bst_path = {}
function! s:type_fix_bst_path.fix(ctx, entry) abort " {{{1
let l:filename = has_key(a:entry, 'filename')
\ ? a:entry.filename
\ : has_key(a:entry, 'bufnr')
\ ? bufname(a:entry.bufnr)
\ : ''
if l:filename =~# '\.bst$' && !filereadable(l:filename)
let l:path = vimtex#kpsewhich#find(l:filename)
if filereadable(l:path)
let a:entry.filename = l:path
unlet! a:entry.bufnr
endif
endif
endfunction

" }}}1

0 comments on commit 97901b6

Please sign in to comment.