You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
I recently had an issue with my build environment, which lead to badly build color_coded.so library which failed to load. While the issue itself was more or less trivial to fix after the exact cause of the problem was found, the default plugin behavior was not friendly, all that was given was "color_coded unavailable: you need to compile it (see README.md)".
I suggest the pcall invocation to be changed to include the error message and the message printed on failure. I made "quick and dirty" local change, but I believe, it could be better. My changes are:
diff --git a/autoload/color_coded.vim b/autoload/color_coded.vim
index 02e6359..bf6f62e 100644
--- a/autoload/color_coded.vim
+++ b/autoload/color_coded.vim
@@ -42,13 +42,14 @@ function! color_coded#setup()
" Try to get the lua binding working
lua << EOF
package.cpath = vim.eval("$VIMHOME") .. "/color_coded.so"
- local loaded = pcall(require, "color_coded")
+ local loaded, err = pcall(require, "color_coded")
if not loaded then
vim.command('echohl WarningMsg | ' ..
'echomsg "color_coded unavailable: you need to compile it ' ..
- '(see README.md)" | ' ..
+ '(see README.md) ' .. package.cpath .. '" | ' ..
'echohl None')
vim.command("let s:color_coded_valid = 0")
+ print(err)
return
else
local version = color_coded_api_version()
The text was updated successfully, but these errors were encountered:
Thanks for the detailed ticket! I'm glad you were able to sort out your issue with a minimal change to the code. I think, in general, this is a pretty good proposed change, but I think we can redirect the error output to a color_coded.log, perhaps. Are you up for making a PR with the above changes, except just printing the error output to a file?
From there, we'll just need to update the readme to mention the error log file. You could include that in the PR or I could do it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I recently had an issue with my build environment, which lead to badly build color_coded.so library which failed to load. While the issue itself was more or less trivial to fix after the exact cause of the problem was found, the default plugin behavior was not friendly, all that was given was "color_coded unavailable: you need to compile it (see README.md)".
I suggest the pcall invocation to be changed to include the error message and the message printed on failure. I made "quick and dirty" local change, but I believe, it could be better. My changes are:
The text was updated successfully, but these errors were encountered: