mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0953: get "no write since last change" error in terminal window
Problem: Get "no write since last change" error in terminal window. Solution: Use another message when closing a terminal window. Make ":quit!" also end the job.
This commit is contained in:
28
src/buffer.c
28
src/buffer.c
@@ -473,8 +473,8 @@ close_buffer(
|
||||
{
|
||||
if (term_job_running(buf->b_term))
|
||||
{
|
||||
if (wipe_buf)
|
||||
/* Wiping out a terminal buffer kills the job. */
|
||||
if (wipe_buf || unload_buf)
|
||||
/* Wiping out or unloading a terminal buffer kills the job. */
|
||||
free_terminal(buf);
|
||||
else
|
||||
{
|
||||
@@ -1648,7 +1648,7 @@ do_buffer(
|
||||
if (bufIsChanged(curbuf))
|
||||
#endif
|
||||
{
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -1897,6 +1897,28 @@ do_autochdir(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
no_write_message(void)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(curbuf->b_term))
|
||||
EMSG(_("E948: Job still running (add ! to end the job)"));
|
||||
else
|
||||
#endif
|
||||
EMSG(_("E37: No write since last change (add ! to override)"));
|
||||
}
|
||||
|
||||
void
|
||||
no_write_message_nobang(void)
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_job_running(curbuf->b_term))
|
||||
EMSG(_("E948: Job still running"));
|
||||
else
|
||||
#endif
|
||||
EMSG(_("E37: No write since last change"));
|
||||
}
|
||||
|
||||
/*
|
||||
* functions for dealing with the buffer list
|
||||
*/
|
||||
|
Reference in New Issue
Block a user