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.
This commit is contained in:
parent
704dd5d63c
commit
1da465eedf
1 changed files with 4 additions and 2 deletions
|
|
@ -52,8 +52,10 @@ endf
|
||||||
augroup NimVim
|
augroup NimVim
|
||||||
au!
|
au!
|
||||||
au BufEnter log://nim call s:UpdateNimLog()
|
au BufEnter log://nim call s:UpdateNimLog()
|
||||||
" au QuitPre * :py nimTerminateAll()
|
if has("python3") || has("python")
|
||||||
au VimLeavePre * :py nimTerminateAll()
|
" au QuitPre * :py nimTerminateAll()
|
||||||
|
au VimLeavePre * :py nimTerminateAll()
|
||||||
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
command! NimLog :e log://nim
|
command! NimLog :e log://nim
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue