mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.0.1525: using :wqa exits even if a job runs in a terminal window
Problem: Using :wqa exits even if a job runs in a terminal window. (Jason Felice) Solution: Check if a terminal has a running job. (closes #2654)
This commit is contained in:
@@ -1875,10 +1875,10 @@ no_write_message(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
no_write_message_nobang(void)
|
no_write_message_nobang(buf_T *buf UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TERMINAL
|
#ifdef FEAT_TERMINAL
|
||||||
if (term_job_running(curbuf->b_term))
|
if (term_job_running(buf->b_term))
|
||||||
EMSG(_("E948: Job still running"));
|
EMSG(_("E948: Job still running"));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@@ -3428,6 +3428,14 @@ do_wqall(exarg_T *eap)
|
|||||||
|
|
||||||
FOR_ALL_BUFFERS(buf)
|
FOR_ALL_BUFFERS(buf)
|
||||||
{
|
{
|
||||||
|
#ifdef FEAT_TERMINAL
|
||||||
|
if (exiting && term_job_running(buf->b_term))
|
||||||
|
{
|
||||||
|
no_write_message_nobang(buf);
|
||||||
|
++error;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
if (bufIsChanged(buf) && !bt_dontwrite(buf))
|
if (bufIsChanged(buf) && !bt_dontwrite(buf))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@@ -2110,7 +2110,7 @@ check_changed(buf_T *buf, int flags)
|
|||||||
if (flags & CCGD_EXCMD)
|
if (flags & CCGD_EXCMD)
|
||||||
no_write_message();
|
no_write_message();
|
||||||
else
|
else
|
||||||
no_write_message_nobang();
|
no_write_message_nobang(curbuf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -14,7 +14,7 @@ void set_curbuf(buf_T *buf, int action);
|
|||||||
void enter_buffer(buf_T *buf);
|
void enter_buffer(buf_T *buf);
|
||||||
void do_autochdir(void);
|
void do_autochdir(void);
|
||||||
void no_write_message(void);
|
void no_write_message(void);
|
||||||
void no_write_message_nobang(void);
|
void no_write_message_nobang(buf_T *buf);
|
||||||
buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags);
|
buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags);
|
||||||
void free_buf_options(buf_T *buf, int free_p_ff);
|
void free_buf_options(buf_T *buf, int free_p_ff);
|
||||||
int buflist_getfile(int n, linenr_T lnum, int options, int forceit);
|
int buflist_getfile(int n, linenr_T lnum, int options, int forceit);
|
||||||
|
@@ -712,6 +712,15 @@ func Test_terminal_wall()
|
|||||||
unlet g:job
|
unlet g:job
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_terminal_wqall()
|
||||||
|
let buf = Run_shell_in_terminal({})
|
||||||
|
call assert_fails('wqall', 'E948')
|
||||||
|
call Stop_shell_in_terminal(buf)
|
||||||
|
call term_wait(buf)
|
||||||
|
exe buf . 'bwipe'
|
||||||
|
unlet g:job
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_composing_unicode()
|
func Test_terminal_composing_unicode()
|
||||||
let save_enc = &encoding
|
let save_enc = &encoding
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
|
@@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1525,
|
||||||
/**/
|
/**/
|
||||||
1524,
|
1524,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user