comparison src/terminal.c @ 29038:ad99b7b9df13 v8.2.5041

patch 8.2.5041: cannot close a terminal popup with "NONE" job Commit: https://github.com/vim/vim/commit/9e636b9d2ef54552383daebf290d916b3d001823 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 29 22:37:05 2022 +0100 patch 8.2.5041: cannot close a terminal popup with "NONE" job Problem: Cannot close a terminal popup with "NONE" job. Solution: Adjust the conditions for whether a job is running. (closes #10498)
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 May 2022 23:45:03 +0200
parents 983ec746af54
children 87c00c420d27
comparison
equal deleted inserted replaced
29037:28cdce891562 29038:ad99b7b9df13
1628 { 1628 {
1629 return term_job_running_check(term, FALSE); 1629 return term_job_running_check(term, FALSE);
1630 } 1630 }
1631 1631
1632 /* 1632 /*
1633 * Return TRUE if the job for "term" is still running, ignoring the job was
1634 * "NONE".
1635 */
1636 int
1637 term_job_running_not_none(term_T *term)
1638 {
1639 return term_job_running(term) && !term_none_open(term);
1640 }
1641
1642 /*
1633 * Return TRUE if "term" has an active channel and used ":term NONE". 1643 * Return TRUE if "term" has an active channel and used ":term NONE".
1634 */ 1644 */
1635 int 1645 int
1636 term_none_open(term_T *term) 1646 term_none_open(term_T *term)
1637 { 1647 {
3510 */ 3520 */
3511 int 3521 int
3512 may_close_term_popup(void) 3522 may_close_term_popup(void)
3513 { 3523 {
3514 if (popup_is_popup(curwin) && curbuf->b_term != NULL 3524 if (popup_is_popup(curwin) && curbuf->b_term != NULL
3515 && !term_job_running(curbuf->b_term)) 3525 && !term_job_running_not_none(curbuf->b_term))
3516 { 3526 {
3517 win_T *pwin = curwin; 3527 win_T *pwin = curwin;
3518 3528
3519 if (win_valid(prevwin)) 3529 if (win_valid(prevwin))
3520 win_enter(prevwin, FALSE); 3530 win_enter(prevwin, FALSE);