Mercurial > vim
diff src/undo.c @ 11957:bc0fee081e1e
patch 8.0.0858: can exit while a terminal is still running a job
commit https://github.com/vim/vim/commit/eb44a68b42eda207a5bc4def9ea8fc4d38acb650
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 3 22:44:55 2017 +0200
patch 8.0.0858: can exit while a terminal is still running a job
Problem: Can exit while a terminal is still running a job.
Solution: Consider a buffer with a running job like a changed file.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 03 Aug 2017 22:45:04 +0200 |
parents | f080b225a2a4 |
children | e971ef6c0dee |
line wrap: on
line diff
--- a/src/undo.c +++ b/src/undo.c @@ -3522,21 +3522,18 @@ u_save_line(linenr_T lnum) int bufIsChanged(buf_T *buf) { - return -#ifdef FEAT_QUICKFIX - !bt_dontwrite(buf) && +#ifdef FEAT_TERMINAL + if (term_job_running(buf->b_term)) + return TRUE; #endif - (buf->b_changed || file_ff_differs(buf, TRUE)); + return !bt_dontwrite(buf) + && (buf->b_changed || file_ff_differs(buf, TRUE)); } int curbufIsChanged(void) { - return -#ifdef FEAT_QUICKFIX - !bt_dontwrite(curbuf) && -#endif - (curbuf->b_changed || file_ff_differs(curbuf, TRUE)); + return bufIsChanged(curbuf); } #if defined(FEAT_EVAL) || defined(PROTO)