0
0
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:
Bram Moolenaar
2016-02-07 14:27:38 +01:00
parent c5f98ee987
commit 835dc636a5
9 changed files with 611 additions and 104 deletions

View File

@@ -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")