vim-patch:8.0.0858: check if job terminal is running #10908

Problem:    Can exit while a terminal is still running a job.
Solution:   Consider a buffer with a running job like a changed file.
eb44a68b42
This commit is contained in:
Jan Edmund Lazo
2019-09-02 01:54:49 -04:00
committed by Justin M. Keyes
parent 299331490e
commit 7bb029eeef
2 changed files with 5 additions and 7 deletions

View File

@@ -2962,7 +2962,7 @@ static char_u *u_save_line(linenr_T lnum)
///
/// @return true if the buffer has changed
bool bufIsChanged(buf_T *buf)
FUNC_ATTR_WARN_UNUSED_RESULT
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
return !bt_dontwrite(buf) && (buf->b_changed || file_ff_differs(buf, true));
}
@@ -2979,15 +2979,12 @@ bool anyBufIsChanged(void)
return false;
}
/// Check if the 'modified' flag is set, or 'ff' has changed (only need to
/// check the first character, because it can only be "dos", "unix" or "mac").
/// "nofile" and "scratch" type buffers are considered to always be unchanged.
///
/// @see bufIsChanged
/// @return true if the current buffer has changed
bool curbufIsChanged(void)
FUNC_ATTR_WARN_UNUSED_RESULT
{
return (!bt_dontwrite(curbuf)
&& (curbuf->b_changed || file_ff_differs(curbuf, true)));
return bufIsChanged(curbuf);
}
/// Append the list of undo blocks to a newly allocated list