To: vim_dev@googlegroups.com Subject: Patch 8.2.5045 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/popupwin.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_poptermscroll_1.dump, src/testdir/dumps/Test_popupwin_poptermscroll_2.dump, src/testdir/dumps/Test_popupwin_poptermscroll_3.dump, src/testdir/dumps/Test_popupwin_poptermscroll_4.dump *** ../vim-8.2.5044/src/popupwin.c 2022-05-30 13:20:53.128825627 +0100 --- src/popupwin.c 2022-05-30 17:54:40.126781536 +0100 *************** *** 2760,2766 **** if (WIN_IS_POPUP(curwin) # ifdef FEAT_TERMINAL && (also_with_term || curbuf->b_term == NULL) - && !term_is_finished(curbuf) # endif ) { --- 2760,2765 ---- *** ../vim-8.2.5044/src/testdir/test_popupwin.vim 2022-05-30 13:20:53.128825627 +0100 --- src/testdir/test_popupwin.vim 2022-05-30 17:45:49.639212464 +0100 *************** *** 2907,2912 **** --- 2907,2915 ---- 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,2933 **** call term_sendkeys(buf, "50%") call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_2', {}) " close the popupwin. call term_sendkeys(buf, ":q\") ! call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_3', {}) call StopVimInTerminal(buf) call delete('Xtestfile') --- 2928,2940 ---- call term_sendkeys(buf, "50%") call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_2', {}) + " get error if trying to escape the window + call term_sendkeys(buf, "\\") + call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_3', {}) + " close the popupwin. call term_sendkeys(buf, ":q\") ! call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_4', {}) call StopVimInTerminal(buf) call delete('Xtestfile') *** ../vim-8.2.5044/src/testdir/dumps/Test_popupwin_poptermscroll_1.dump 2022-05-29 14:12:38.378920226 +0100 --- src/testdir/dumps/Test_popupwin_poptermscroll_1.dump 2022-05-30 17:47:14.895064010 +0100 *************** *** 4,15 **** |~| @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 |~| @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| --- 4,15 ---- |~| @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 ! |[+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 ! |[+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| *** ../vim-8.2.5044/src/testdir/dumps/Test_popupwin_poptermscroll_2.dump 2022-05-29 14:12:38.378920226 +0100 --- src/testdir/dumps/Test_popupwin_poptermscroll_2.dump 2022-05-30 17:47:16.059061991 +0100 *************** *** 4,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 ! |~| @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 |~| @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|%| --- 4,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 ! | +0&&@56|2|5|,|1| @9|5|0|%| *** ../vim-8.2.5044/src/testdir/dumps/Test_popupwin_poptermscroll_3.dump 2022-05-29 14:12:38.378920226 +0100 --- src/testdir/dumps/Test_popupwin_poptermscroll_3.dump 2022-05-30 17:47:17.219059977 +0100 *************** *** 1,15 **** ! > +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| --- 1,15 ---- ! | +0&#ffffff0@74 |~+0#4040ff13&| @73 + |~| @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 *** ../vim-8.2.5044/src/testdir/dumps/Test_popupwin_poptermscroll_4.dump 2022-05-30 17:56:08.486697314 +0100 --- src/testdir/dumps/Test_popupwin_poptermscroll_4.dump 2022-05-30 17:47:18.375057972 +0100 *************** *** 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 *** ../vim-8.2.5044/src/version.c 2022-05-30 16:01:38.999629604 +0100 --- src/version.c 2022-05-30 17:41:10.323706849 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5045, /**/ -- You know you use Vim too much when you have this alias in your ~/.bashrc file: alias :e=/bin/vim (Eljay Love-Jensen) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///