Skip to content

Commit

Permalink
vim-patch:8.0.1593: :qall never exits active :terminal #11704
Browse files Browse the repository at this point in the history
Problem:    :qall never exits with an active terminal window.
Solution:   Add a way to kill a job in a terminal window.
vim/vim@25cdd9c
  • Loading branch information
janlazo authored and justinmk committed Jan 12, 2020
1 parent 462ee28 commit 1cbe8d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nvim/ex_cmds2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,7 @@ bool check_changed_any(bool hidden, bool unload)
size_t bufcount = 0;
int *bufnrs;

// Make a list of all buffers, with the most important ones first.
FOR_ALL_BUFFERS(buf) {
bufcount++;
}
Expand All @@ -1426,14 +1427,15 @@ bool check_changed_any(bool hidden, bool unload)

// curbuf
bufnrs[bufnum++] = curbuf->b_fnum;
// buf in curtab

// buffers in current tab
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp->w_buffer != curbuf) {
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
}
}

// buf in other tab
// buffers in other tabs
FOR_ALL_TABS(tp) {
if (tp != curtab) {
FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
Expand All @@ -1442,7 +1444,7 @@ bool check_changed_any(bool hidden, bool unload)
}
}

// any other buf
// any other buffer
FOR_ALL_BUFFERS(buf) {
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
}
Expand Down Expand Up @@ -1471,6 +1473,7 @@ bool check_changed_any(bool hidden, bool unload)
goto theend;
}

// Get here if "buf" cannot be abandoned.
ret = true;
exiting = false;
// When ":confirm" used, don't give an error message.
Expand Down

0 comments on commit 1cbe8d6

Please sign in to comment.