Use pyx or pyxfile

This commit is contained in:
Yasuhiro Matsumoto 2020-10-16 11:10:05 +09:00 committed by zah
commit 413244f3c3

View file

@ -9,10 +9,8 @@ if !executable('nim')
echoerr "the Nim compiler must be in your system's PATH" echoerr "the Nim compiler must be in your system's PATH"
endif endif
if has("python3") if has('pythonx')
exe 'py3file ' . fnameescape(s:plugin_path) . '/nim_vim.py' exe 'pyxfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
elseif has("python")
exe 'pyfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
endif endif
fun! nim#init() fun! nim#init()
@ -54,19 +52,19 @@ endf
augroup NimVim augroup NimVim
au! au!
au BufEnter log://nim call s:UpdateNimLog() au BufEnter log://nim call s:UpdateNimLog()
if has("python3") || has("python") if has("pythonx")
" au QuitPre * :py nimTerminateAll() " au QuitPre * :pyx nimTerminateAll()
au VimLeavePre * :py nimTerminateAll() au VimLeavePre * :pyx nimTerminateAll()
endif endif
augroup END augroup END
command! NimLog :e log://nim command! NimLog :e log://nim
command! NimTerminateService command! NimTerminateService
\ :exe printf("py nimTerminateService('%s')", b:nim_project_root) \ :exe printf("pyx nimTerminateService('%s')", b:nim_project_root)
command! NimRestartService command! NimRestartService
\ :exe printf("py nimRestartService('%s')", b:nim_project_root) \ :exe printf("pyx nimRestartService('%s')", b:nim_project_root)
fun! s:CurrentNimFile() fun! s:CurrentNimFile()
let save_cur = getpos('.') let save_cur = getpos('.')
@ -120,7 +118,7 @@ fun! NimExec(op)
endif endif
if b:nim_caas_enabled if b:nim_caas_enabled
exe printf("py nimExecCmd('%s', '%s', False)", b:nim_project_root, cmd) exe printf("pyx nimExecCmd('%s', '%s', False)", b:nim_project_root, cmd)
let output = l:py_res let output = l:py_res
else else
let output = system("nim " . cmd) let output = system("nim " . cmd)