<commit_before>" VimTeX - LaTeX plugin for Vim
"
" Maintainer: <NAME>
" Email:      <EMAIL>
"

function! vimtex#doc#init_buffer() abort " {{{1
  command! -buffer -nargs=? VimtexDocPackage call vimtex#doc#package(<q-args>)

  nnoremap <buffer> <plug>(vimtex-doc-package) :VimtexDocPackage<cr>
endfunction

" }}}1

function! vimtex#doc#get_context(...) abort " {{{1
  let l:context = a:0 == 0 || empty(a:1)
        \ ? s:packages_get_from_cursor()
        \ : {
        \     'type': 'word',
        \     'candidates': [a:word],
        \   }
  if empty(l:context) | return {} | endif

  call s:packages_remove_invalid(l:context)

  return l:context
endfunction

" }}}1
function! vimtex#doc#package(word) abort " {{{1
  let l:context = vimtex#doc#get_context(a:word)
  if empty(l:context) | return | endif

  for l:handler in g:vimtex_doc_handlers<commit_msg>fix: minor regression error<commit_after>" VimTeX - LaTeX plugin for Vim
"
" Maintainer: <NAME>
" Email:      <EMAIL>
"

function! vimtex#doc#init_buffer() abort " {{{1
  command! -buffer -nargs=? VimtexDocPackage call vimtex#doc#package(<q-args>)

  nnoremap <buffer> <plug>(vimtex-doc-package) :VimtexDocPackage<cr>
endfunction

" }}}1

function! vimtex#doc#get_context(...) abort " {{{1
  let l:word = a:0 > 0 ? a:1 : ''
  let l:context = empty(l:word)
        \ ? s:packages_get_from_cursor()
        \ : {
        \     'type': 'word',
        \     'candidates': [l:word],
        \   }
  if empty(l:context) | return {} | endif

  call s:packages_remove_invalid(l:context)

  return l:context
endfunction

" }}}1
function! vimtex#doc#package(word) abort " {{{1
  let l:context = vimtex#doc#get_context(a:word)
  if empty(l:context) | return | endif

  for l:handler in g:vimtex_doc_handlers
{'fraction_non_alphanumeric': 0.15897435897435896, 'fraction_numerical': 0.009116809116809116, 'mean_word_length': 3.5492227979274613, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81160', 'n_tokens_mistral': 688, 'n_tokens_neox': 660, 'n_words': 135}