Skip to content

Commit

Permalink
chore: avoid deprecated api
Browse files Browse the repository at this point in the history
refer: #2838
  • Loading branch information
lervag committed Nov 26, 2023
1 parent 283252f commit f5659cf
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions autoload/health/vimtex.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function! health#vimtex#check() abort
call vimtex#options#init()

call health#report_start('VimTeX')
call v:lua.vim.health.start('VimTeX')

call s:check_general()
call s:check_plugin_clash()
Expand All @@ -11,17 +11,17 @@ endfunction

function! s:check_general() abort " {{{1
if !has('nvim') || v:version < 800
call health#report_warn('VimTeX works best with Vim 8 or neovim')
call v:lua.vim.health.warn('VimTeX works best with Vim 8 or neovim')
else
call health#report_ok('Vim version should have full support!')
call v:lua.vim.health.ok('Vim version should have full support!')
endif

if !executable('bibtex')
call health#report_warn('bibtex is not executable!',
call v:lua.vim.health.warn('bibtex is not executable!',
\ 'bibtex is required for cite completions.')
endif
if !executable('biber')
call health#report_warn(
call v:lua.vim.health.warn(
\ 'biber is not executable!',
\ 'Biber is often required so this may give unexpected problems.')
endif
Expand All @@ -34,13 +34,13 @@ function! s:check_compiler() abort " {{{1

if !executable(g:vimtex_compiler_method)
let l:ind = ' '
call health#report_error(printf(
call v:lua.vim.health.error(printf(
\ '|g:vimtex_compiler_method| (`%s`) is not executable!',
\ g:vimtex_compiler_method))
return
endif

call health#report_ok('Compiler should work!')
call v:lua.vim.health.ok('Compiler should work!')
endfunction

" }}}1
Expand All @@ -51,9 +51,9 @@ function! s:check_plugin_clash() abort " {{{1

let l:latexbox = !empty(filter(copy(l:scriptnames), "v:val =~# 'latex-box'"))
if l:latexbox
call health#report_warn('Conflicting plugin detected: LaTeX-Box')
call health#report_info('VimTeX does not work as expected when LaTeX-Box is installed!')
call health#report_info('Please disable or remove it to use VimTeX!')
call v:lua.vim.health.warn('Conflicting plugin detected: LaTeX-Box')
call v:lua.vim.health.info('VimTeX does not work as expected when LaTeX-Box is installed!')
call v:lua.vim.health.info('Please disable or remove it to use VimTeX!')
endif
endfunction

Expand All @@ -63,17 +63,17 @@ function! s:check_view() abort " {{{1
call s:check_view_{g:vimtex_view_method}()

if executable('xdotool') && !executable('pstree')
call health#report_warn('pstree is not available',
call v:lua.vim.health.warn('pstree is not available',
\ 'vimtex#view#inverse_search is better if pstree is available.')
endif
endfunction

" }}}1
function! s:check_view_general() abort " {{{1
if executable(g:vimtex_view_general_viewer)
call health#report_ok('General viewer should work properly!')
call v:lua.vim.health.ok('General viewer should work properly!')
else
call health#report_error(
call v:lua.vim.health.error(
\ 'Selected viewer is not executable!',
\ '- Selection: ' . g:vimtex_view_general_viewer,
\ '- Please see :h g:vimtex_view_general_viewer')
Expand All @@ -85,17 +85,17 @@ function! s:check_view_zathura() abort " {{{1
let l:ok = 1

if !executable('zathura')
call health#report_error('Zathura is not executable!')
call v:lua.vim.health.error('Zathura is not executable!')
let l:ok = 0
endif

if !executable('xdotool')
call health#report_warn('Zathura requires xdotool for forward search!')
call v:lua.vim.health.warn('Zathura requires xdotool for forward search!')
let l:ok = 0
endif

if l:ok
call health#report_ok('Zathura should work properly!')
call v:lua.vim.health.ok('Zathura should work properly!')
endif
endfunction

Expand All @@ -104,12 +104,12 @@ function! s:check_view_zathura_simple() abort " {{{1
let l:ok = 1

if !executable('zathura')
call health#report_error('Zathura is not executable!')
call v:lua.vim.health.error('Zathura is not executable!')
let l:ok = 0
endif

if l:ok
call health#report_ok('Zathura should work properly!')
call v:lua.vim.health.ok('Zathura should work properly!')
endif
endfunction

Expand All @@ -118,22 +118,22 @@ function! s:check_view_mupdf() abort " {{{1
let l:ok = 1

if !executable('mupdf')
call health#report_error('MuPDF is not executable!')
call v:lua.vim.health.error('MuPDF is not executable!')
let l:ok = 0
endif

if !executable('xdotool')
call health#report_warn('MuPDF requires xdotool for forward search!')
call v:lua.vim.health.warn('MuPDF requires xdotool for forward search!')
let l:ok = 0
endif

if !executable('synctex')
call health#report_warn('MuPDF requires synctex for forward search!')
call v:lua.vim.health.warn('MuPDF requires synctex for forward search!')
let l:ok = 0
endif

if l:ok
call health#report_ok('MuPDF should work properly!')
call v:lua.vim.health.ok('MuPDF should work properly!')
endif
endfunction

Expand All @@ -142,12 +142,12 @@ function! s:check_view_sioyek() abort " {{{1
let l:ok = 1

if !executable(g:vimtex_view_sioyek_exe)
call health#report_error('Sioyek is not executable!')
call v:lua.vim.health.error('Sioyek is not executable!')
let l:ok = 0
endif

if l:ok
call health#report_ok('Sioyek should work properly!')
call v:lua.vim.health.ok('Sioyek should work properly!')
endif
endfunction

Expand All @@ -160,9 +160,9 @@ function! s:check_view_skim() abort " {{{1
\]))

if v:shell_error == 0
call health#report_ok('Skim viewer should work!')
call v:lua.vim.health.ok('Skim viewer should work!')
else
call health#report_error('Skim is not installed!')
call v:lua.vim.health.error('Skim is not installed!')
endif
endfunction

Expand All @@ -175,9 +175,9 @@ function! s:check_view_texshop() abort " {{{1
\])

if system(l:cmd)
call health#report_error('TeXShop is not installed!')
call v:lua.vim.health.error('TeXShop is not installed!')
else
call health#report_ok('TeXShop viewer should work!')
call v:lua.vim.health.ok('TeXShop viewer should work!')
endif
endfunction

Expand Down

0 comments on commit f5659cf

Please sign in to comment.