mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 7.4.1274
Problem: Cannot run a job. Solution: Add job_start(), job_status() and job_stop(). Currently only works for Unix.
This commit is contained in:
@@ -8,8 +8,9 @@ endif
|
||||
" This test requires the Python command to run the test server.
|
||||
" This most likely only works on Unix and Windows.
|
||||
if has('unix')
|
||||
" We also need the pkill command to make sure the server can be stopped.
|
||||
if !executable('python') || !executable('pkill')
|
||||
" We also need the job feature or the pkill command to make sure the server
|
||||
" can be stopped.
|
||||
if !(executable('python') && (has('job') || executable('pkill')))
|
||||
finish
|
||||
endif
|
||||
elseif has('win32')
|
||||
@@ -27,7 +28,9 @@ func s:start_server()
|
||||
" The Python program writes the port number in Xportnr.
|
||||
call delete("Xportnr")
|
||||
|
||||
if has('win32')
|
||||
if has('job')
|
||||
let s:job = job_start("python test_channel.py")
|
||||
elseif has('win32')
|
||||
silent !start cmd /c start "test_channel" py test_channel.py
|
||||
else
|
||||
silent !python test_channel.py&
|
||||
@@ -62,7 +65,9 @@ func s:start_server()
|
||||
endfunc
|
||||
|
||||
func s:kill_server()
|
||||
if has('win32')
|
||||
if has('job')
|
||||
call job_stop(s:job)
|
||||
elseif has('win32')
|
||||
call system('taskkill /IM py.exe /T /F /FI "WINDOWTITLE eq test_channel"')
|
||||
else
|
||||
call system("pkill -f test_channel.py")
|
||||
|
Reference in New Issue
Block a user