From 7280140c08799f683ef31a6c1019e283c3dc13aa Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 9 Feb 2016 11:37:50 +0100 Subject: [PATCH 1/4] patch 7.4.1294 Problem: job_stop() only kills the started process. Solution: Send the signal to the process group. (Olaf Dabrunz) --- src/os_unix.c | 8 +++++++- src/version.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/os_unix.c b/src/os_unix.c index a0e5ed0bc6..17bb32268d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3920,6 +3920,11 @@ wait4pid(pid_t child, waitstatus *status) } #if defined(FEAT_JOB) || !defined(USE_SYSTEM) || defined(PROTO) +/* + * Parse "cmd" and put the white-separated parts in "argv". + * "argv" is an allocated array with "argc" entries. + * Returns FAIL when out of memory. + */ int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc) { @@ -5107,7 +5112,8 @@ mch_stop_job(job_T *job, char_u *how) sig = atoi((char *)how); else return FAIL; - kill(job->jv_pid, sig); + /* TODO: have an option to only kill the process, not the group? */ + kill(-job->jv_pid, sig); return OK; } #endif diff --git a/src/version.c b/src/version.c index b5bf05ea0f..1be6854fdc 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1294, /**/ 1293, /**/ From 4d8747cdfc13843a5680dc8340fbeb6d32e7b626 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 9 Feb 2016 20:39:26 +0100 Subject: [PATCH 2/4] patch 7.4.1295 Problem: string(job) doesn't work well on MS-Windows. Solution: Use the process ID. (Yasuhiro Matsumoto) --- src/eval.c | 6 +++++- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 33f95ef30b..8cc8d0519e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -21606,8 +21606,12 @@ get_tv_string_buf_chk(typval_T *varp, char_u *buf) # ifdef UNIX vim_snprintf((char *)buf, NUMBUFLEN, "process %ld %s", (long)job->jv_pid, status); +# elif defined(WIN32) + vim_snprintf((char *)buf, NUMBUFLEN, + "process %ld %s", (long)job->jf_pi.dwProcessId, + status); # else - /* TODO */ + /* fall-back */ vim_snprintf((char *)buf, NUMBUFLEN, "process ? %s", status); # endif return buf; diff --git a/src/version.c b/src/version.c index 1be6854fdc..491b94a98c 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1295, /**/ 1294, /**/ From f068dcafcfe0c8018e5a559c50769ca1364bd9a5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 9 Feb 2016 21:24:46 +0100 Subject: [PATCH 3/4] patch 7.4.1296 Problem: Cursor changes column with up motion when the matchparen plugin saves and restores the cursor position. (Martin Kunev) Solution: Make sure curswant is updated before invoking the autocommand. --- src/edit.c | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/edit.c b/src/edit.c index 4edf4f4f67..344f3793ac 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1611,7 +1611,12 @@ ins_redraw( # endif # ifdef FEAT_AUTOCMD if (has_cursormovedI()) + { + /* Make sure curswant is correct, an autocommand may call + * getcurpos(). */ + update_curswant(); apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf); + } # endif # ifdef FEAT_CONCEAL if (curwin->w_p_cole > 0) diff --git a/src/version.c b/src/version.c index 491b94a98c..131ef4bc1a 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1296, /**/ 1295, /**/ From a483326e3b04215b86fe9c582ac96bb9679f0812 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 9 Feb 2016 23:33:25 +0100 Subject: [PATCH 4/4] patch 7.4.1297 Problem: On Mac test_channel leaves python instances running. Solution: Use a small waittime to make ch_open() work. (Ozaki Kiichi) --- src/testdir/test_channel.vim | 7 ++++--- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 7d82094f21..432171d9b4 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -23,6 +23,7 @@ else endif let s:port = -1 +let s:chopt = has('macunix') ? {'waittime' : 1} : {} func s:start_server() " The Python program writes the port number in Xportnr. @@ -60,7 +61,7 @@ func s:start_server() endif let s:port = l[0] - let handle = ch_open('localhost:' . s:port) + let handle = ch_open('localhost:' . s:port, s:chopt) return handle endfunc @@ -155,7 +156,7 @@ func Test_two_channels() endif call assert_equal('got it', ch_sendexpr(handle, 'hello!')) - let newhandle = ch_open('localhost:' . s:port) + let newhandle = ch_open('localhost:' . s:port, s:chopt) call assert_equal('got it', ch_sendexpr(newhandle, 'hello!')) call assert_equal('got it', ch_sendexpr(handle, 'hello!')) @@ -181,7 +182,7 @@ endfunc " Test that trying to connect to a non-existing port fails quickly. func Test_connect_waittime() let start = reltime() - let handle = ch_open('localhost:9876') + let handle = ch_open('localhost:9876', s:chopt) if handle >= 0 " Oops, port does exists. call ch_close(handle) diff --git a/src/version.c b/src/version.c index 131ef4bc1a..23ee41b619 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1297, /**/ 1296, /**/