clipboard-image.nvim icon indicating copy to clipboard operation
clipboard-image.nvim copied to clipboard

Fix :checkhealth to call vim.health

Open dfendr opened this issue 1 year ago • 9 comments

Changed health check function to work properly, modelled after documentation here: https://neovim.io/doc/user/pi_health.html#health-dev.

dfendr avatar Mar 16 '23 16:03 dfendr

I think this really needs to be merged! Was really confused by the errors I was getting after updating.

prescientmoon avatar Apr 19 '23 21:04 prescientmoon

I tested this out in WSL / neovim 9 and this did fix the checkhealth issue.

diablozzq avatar Apr 20 '23 14:04 diablozzq

@ekickx is there any option that this gets merged? otherwise theres no way this works on neovim 0.9.x

alxndr13 avatar Jun 13 '23 08:06 alxndr13

@ekickx is there any option that this gets merged? otherwise theres no way this works on neovim 0.9.x

Feel free to use my fork in the meantime if you don't want to change the code yourself, the author hasn't responded in awhile. https://github.com/postfen/clipboard-image.nvim

Otherwise, you can edit the health.lua file in the following ways.

Remove line 3,

local health = require "health"

and change these lines (51-57)

 health.report_start "Checking dependencies"
  if is_dep_exist then
    health.report_ok(report_msg)
  else
    health.report_error(report_msg)
  end
end

to this:

  vim.health.start("Checking dependencies")
  if is_dep_exist then
    vim.health.ok(report_msg)
  else
    vim.health.error(report_msg)
  end
end

dfendr avatar Jun 13 '23 17:06 dfendr

@postfen thanks, i am currently using your fork :)

alxndr13 avatar Jun 14 '23 08:06 alxndr13

I am using @postfen fork as well. His changes fixed the issue with the addon plugin

image

JeffLabonte avatar Jun 16 '23 18:06 JeffLabonte

@ekickx 😄 it would be nice if you reviewed this. It is blocking a lot of us from using your code 😢

JeffLabonte avatar Jun 16 '23 18:06 JeffLabonte

Hmm, @postfen 's fork works well.

tan-wei avatar Oct 11 '23 05:10 tan-wei

Using @dfendr 's fork as well 👍🏻

Drew-Daniels avatar Oct 11 '23 16:10 Drew-Daniels