diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-17 16:55:13 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-17 16:55:13 +0200 |
commit | f5be7cd01642fafc4b7d68894eb60cca60c7a405 (patch) | |
tree | bcbb7f2839092ec9b2d68b4d30b2678efff71d99 /src/buffer.c | |
parent | a83e3962ac0e4bbfef15a072ad9a7390fc255409 (diff) |
patch 8.0.0953: get "no write since last change" error in terminal windowv8.0.0953
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.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c index 3934941565..f64255d785 100644 --- a/src/buffer.c +++ b/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 */ |