patch 7.4.1274
Problem: Cannot run a job.
Solution: Add job_start(), job_status() and job_stop(). Currently only works
for Unix.
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 46bd364..94ad81c 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -8,8 +8,9 @@
" 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 @@
" 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 @@
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")