Mercurial > vim
diff src/os_win32.c @ 8251:989ac3aed1ef v7.4.1418
commit https://github.com/vim/vim/commit/923d926d57d985ec8965da9d0cd3634e6b24bfe1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 25 20:56:01 2016 +0100
patch 7.4.1418
Problem: job_stop() on MS-Windows does not really stop the job.
Solution: Make the default to stop the job forcefully. (Ken Takata)
Make MS-Windows and Unix more similar.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 25 Feb 2016 21:00:04 +0100 |
parents | 4f0677020a43 |
children | 74b15ed0a259 |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -5141,10 +5141,9 @@ mch_job_status(job_T *job) int mch_stop_job(job_T *job, char_u *how) { - int ret = 0; - int ctrl_c = STRCMP(how, "int") == 0; - - if (STRCMP(how, "kill") == 0) + int ret; + + if (STRCMP(how, "term") == 0 || STRCMP(how, "kill") == 0 || *how == NUL) { if (job->jv_job_object != NULL) return TerminateJobObject(job->jv_job_object, 0) ? OK : FAIL; @@ -5155,9 +5154,9 @@ mch_stop_job(job_T *job, char_u *how) if (!AttachConsole(job->jv_proc_info.dwProcessId)) return FAIL; ret = GenerateConsoleCtrlEvent( - ctrl_c ? CTRL_C_EVENT : CTRL_BREAK_EVENT, - job->jv_proc_info.dwProcessId) - ? OK : FAIL; + STRCMP(how, "int") == 0 ? CTRL_C_EVENT : CTRL_BREAK_EVENT, + job->jv_proc_info.dwProcessId) + ? OK : FAIL; FreeConsole(); return ret; }