Skip to content

Conversation

@Ebriopes
Copy link

Fix for the deprecated function health for NeoVIM 0.11+
Based in the issue #161 (comment)

Replaced functions:

  • health#report_start
  • health#report_info
  • health#report_warn
  • health#report_error
  • health#report_ok
Before After
Captura de pantalla 2025-12-22 a la(s) 10 04 51 a m Captura de pantalla 2025-12-22 a la(s) 10 05 44 a m


function! s:check_os() abort
call health#report_start('OS')
call v:lua.vim.health.start('OS')

This comment was marked as duplicate.

@Ebriopes Ebriopes marked this pull request as ready for review December 22, 2025 16:53
endif
endif
endfunction

Copy link
Author

@Ebriopes Ebriopes Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a suggestion to avoid retro-compatibility issues with this:

Suggested change
let s:health = {}
if has("nvim-0.10.0")
let s:health = {
\ 'start': {msg -> luaeval('vim.health.start(_A)', msg)},
\ 'info': {msg -> luaeval('vim.health.info(_A)', msg)},
\ 'warn': {msg -> luaeval('vim.health.warn(_A)', msg)},
\ 'error': {msg -> luaeval('vim.health.error(_A)', msg)},
\ 'ok': {msg -> luaeval('vim.health.ok(_A)', msg)}
\ }
else
let s:health = {
\ 'start': function('health#report_start'),
\ 'info': function('health#report_info'),
\ 'warn': function('health#report_warn'),
\ 'error': function('health#report_error'),
\ 'ok': function('health#report_ok')
\ }
endif

And we can continue updating our new dictionary to use the correct health functionality
Example in comment: #167 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant