ultisnips
ultisnips copied to clipboard
Silent: Remove verbose error if python not loadable
Hi, awesome plugin, I :packadd
it in my vimrc.
Problem: But on many machines, vim python is not well instaled (my bad). Solution: It would be great if Ultisnip just silently fails in that case. My problem, my job: I can do a PR, now I'm asking if dev agrees with this silent fail.
Thanks guys.
PS : the message:
Error detected while processing /home/almamgr/.vim/pack/bundle/opt/ultisnips/autoload/UltiS
nips.vim:
line 7:
E370: Could not load library /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
Error detected while processing /home/almamgr/.vim/pack/bundle/opt/ultisnips/autoload/UltiS
nips.vim:
line 7:
E263: Sorry, this command is disabled, the Python library could not be loaded.
Error detected while processing /home/almamgr/.vim/pack/bundle/opt/ultisnips/autoload/UltiS
nips.vim:
line 8:
E370: Could not load library /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
Error detected while processing /home/almamgr/.vim/pack/bundle/opt/ultisnips/autoload/UltiS
nips.vim:
line 8:
E263: Sorry, this command is disabled, the Python library could not be loaded.
Error detected while processing function UltiSnips#TrackChange:
line 1:
E370: Could not load library /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so
Error detected while processing function UltiSnips#TrackChange:
line 1:
E263: Sorry, this command is disabled, the Python library could not be loaded.
I'm not a dev, but I agree that the stack trace is annoying.
FWIW, I would prefer that – on startup – UltiSnips tests whether the python interface is available, and if not bail out, and log one message so that the user has a chance to understand why the plugin doesn't work by reviewing the output of :messages
.