From b4906577c9f1f0a8bcfa096288d1a56630b142f3 Mon Sep 17 00:00:00 2001 From: Sathya Pramodh <94102031+sathya-pramodh@users.noreply.github.com> Date: Sat, 29 Mar 2025 23:36:23 +0530 Subject: fix(provider): misleading :checkhealth if user sets g:loaded_python3_provider=1 #32696 Problem: :checkhealth shows a confusing message if user sets g:loaded_python3_provider=1. Solution: - Show a warning if that var is set to 1. - Update provider modules to default to 0. Any user code that is checking for 1, is like already broken because these may be set to 2. --- runtime/lua/vim/health/health.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/health/health.lua b/runtime/lua/vim/health/health.lua index dd6fe7f608..38fcd64f88 100644 --- a/runtime/lua/vim/health/health.lua +++ b/runtime/lua/vim/health/health.lua @@ -110,6 +110,16 @@ local function check_config() ) end + if vim.g.loaded_python3_provider == 1 then + ok = false + health.error( + '`g:loaded_python3_provider=1` may have been set by mistake. This option should not be used to load python provider in your config.', + { + 'Remove `vim.g.loaded_python3_provider=1` from your config.', + } + ) + end + local writeable = true local shadaopt = vim.fn.split(vim.o.shada, ',') local shadafile = ( -- cgit