From 1da465eedf2f5cc194a3c25532f46f4271d4a1bd Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Tue, 31 Jul 2018 16:37:35 +0100 Subject: [PATCH] Check for python support before queuing autocmd Versions of Vim compiled without python support will error when attempting to run `:py nimTerminateAll()`, a autocommand for the `VimLeavePre` event. A simple check for python support prevents this. --- autoload/nim.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/nim.vim b/autoload/nim.vim index c52426f..5d6c5b7 100644 --- a/autoload/nim.vim +++ b/autoload/nim.vim @@ -52,8 +52,10 @@ endf augroup NimVim au! au BufEnter log://nim call s:UpdateNimLog() - " au QuitPre * :py nimTerminateAll() - au VimLeavePre * :py nimTerminateAll() + if has("python3") || has("python") + " au QuitPre * :py nimTerminateAll() + au VimLeavePre * :py nimTerminateAll() + endif augroup END command! NimLog :e log://nim