diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-30 17:58:03 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-30 17:58:03 +0100 |
commit | 10db31f9493425a20f1e53d0f214e621f16d65de (patch) | |
tree | 8d24777588ca48ccc73a0830318d0c3170e7d54f | |
parent | be99042b03edf7b8156c9adbc23516bfcf2cec0f (diff) |
patch 8.2.5045: can escape a terminal popup window when the job is finishedv8.2.5045
Problem: Can escape a terminal popup window when the job is finished.
Solution: Only check for a finished job where it is relevant.
(closes #10253)
-rw-r--r-- | src/popupwin.c | 1 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_poptermscroll_1.dump | 10 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_poptermscroll_2.dump | 10 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_poptermscroll_3.dump | 28 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_poptermscroll_4.dump | 15 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
7 files changed, 49 insertions, 26 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index c9f4468b50..bb889d5568 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2760,7 +2760,6 @@ error_if_popup_window(int also_with_term UNUSED) if (WIN_IS_POPUP(curwin) # ifdef FEAT_TERMINAL && (also_with_term || curbuf->b_term == NULL) - && !term_is_finished(curbuf) # endif ) { diff --git a/src/testdir/dumps/Test_popupwin_poptermscroll_1.dump b/src/testdir/dumps/Test_popupwin_poptermscroll_1.dump index a52b8ad20b..510b7b27b5 100644 --- a/src/testdir/dumps/Test_popupwin_poptermscroll_1.dump +++ b/src/testdir/dumps/Test_popupwin_poptermscroll_1.dump @@ -4,12 +4,12 @@ |~| @14|║+0#0000001#ffd7ff255|4|2| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|4|3| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|4@1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255|4|5| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255|4|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255|4|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|[+1#0000000&|N|o| |N|a|m|e|]| @6|║+0#0000001#ffd7ff255|4|5| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255|0+1#0000000#ffffff0|-|1| @9|A|l@1 +| +0&&@15|║+0#0000001#ffd7ff255|4|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@15 +|~+0#4040ff13&| @14|║+0#0000001#ffd7ff255|4|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|4|8| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255>4|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@15 |~| @73 -|~| @73 -| +0#0000000&@56|5|0|,|1| @9|B|o|t| +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@56|5|0|,|1| @9|B|o|t| diff --git a/src/testdir/dumps/Test_popupwin_poptermscroll_2.dump b/src/testdir/dumps/Test_popupwin_poptermscroll_2.dump index 9892397385..2d77aa2846 100644 --- a/src/testdir/dumps/Test_popupwin_poptermscroll_2.dump +++ b/src/testdir/dumps/Test_popupwin_poptermscroll_2.dump @@ -4,12 +4,12 @@ |~| @14|║+0#0000001#ffd7ff255|2|1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|2@1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|2|3| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255>2|4| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255|2|5| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 -|~| @14|║+0#0000001#ffd7ff255|2|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|[+1#0000000&|N|o| |N|a|m|e|]| @6|║+0#0000001#ffd7ff255>2|4| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255|0+1#0000000#ffffff0|-|1| @9|A|l@1 +| +0&&@15|║+0#0000001#ffd7ff255|2|5| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@15 +|~+0#4040ff13&| @14|║+0#0000001#ffd7ff255|2|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|║+0#0000001#ffd7ff255|2|8| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 |~| @14|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@15 |~| @73 -|~| @73 -| +0#0000000&@56|2|5|,|1| @9|5|0|%| +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@56|2|5|,|1| @9|5|0|%| diff --git a/src/testdir/dumps/Test_popupwin_poptermscroll_3.dump b/src/testdir/dumps/Test_popupwin_poptermscroll_3.dump index deaf8da71d..73f13fd83d 100644 --- a/src/testdir/dumps/Test_popupwin_poptermscroll_3.dump +++ b/src/testdir/dumps/Test_popupwin_poptermscroll_3.dump @@ -1,15 +1,15 @@ -> +0&#ffffff0@74 +| +0&#ffffff0@74 |~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|:+0#0000000&|q| @54|0|,|0|-|1| @8|A|l@1| +|~| @14|╔+0#0000001#ffd7ff255|═@40|╗| +0#4040ff13#ffffff0@15 +|~| @14|║+0#0000001#ffd7ff255|2|1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|~| @14|║+0#0000001#ffd7ff255|2@1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|~| @14|║+0#0000001#ffd7ff255|2|3| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|[+1#0000000&|N|o| |N|a|m|e|]| @6|║+0#0000001#ffd7ff255>2|4| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255|0+1#0000000#ffffff0|-|1| @9|A|l@1 +| +0&&@15|║+0#0000001#ffd7ff255|2|5| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@15 +|~+0#4040ff13&| @14|║+0#0000001#ffd7ff255|2|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|~| @14|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|~| @14|║+0#0000001#ffd7ff255|2|8| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15 +|~| @14|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@15 +|~| @73 +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +|E+0#ffffff16#e000002|9@1|4|:| |N|o|t| |a|l@1|o|w|e|d| |i|n| |a| |p|o|p|u|p| |w|i|n|d|o|w| +0#0000000#ffffff0@39 diff --git a/src/testdir/dumps/Test_popupwin_poptermscroll_4.dump b/src/testdir/dumps/Test_popupwin_poptermscroll_4.dump new file mode 100644 index 0000000000..0e7b283684 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_poptermscroll_4.dump @@ -0,0 +1,15 @@ +> +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +|:+0&&|q| @72 diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 950edf2adc..3a0f876f9b 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -2907,6 +2907,9 @@ func Test_popupwin_terminal_scrollbar() let lines =<< trim END vim9script + # testing CTRL-W CTRL-W requires two windows + split + term_start(['cat', 'Xtestfile'], {hidden: true}) ->popup_create({ minwidth: 40, @@ -2925,9 +2928,13 @@ func Test_popupwin_terminal_scrollbar() call term_sendkeys(buf, "50%") call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_2', {}) + " get error if trying to escape the window + call term_sendkeys(buf, "\<C-W>\<C-W>") + call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_3', {}) + " close the popupwin. call term_sendkeys(buf, ":q\<CR>") - call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_3', {}) + call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_4', {}) call StopVimInTerminal(buf) call delete('Xtestfile') diff --git a/src/version.c b/src/version.c index 1e7b2a8442..f1b7010938 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5045, +/**/ 5044, /**/ 5043, |