Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 22518:81ae5fa92928 v8.2.1807
patch 8.2.1807: can use :help in a terminal popup window
Commit: https://github.com/vim/vim/commit/349f609f8990a3aca9a4b8faa0585d75e03116db
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 6 20:46:49 2020 +0200
patch 8.2.1807: can use :help in a terminal popup window
Problem: Can use :help in a terminal popup window.
Solution: Give an error. (closes https://github.com/vim/vim/issues/7088)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 06 Oct 2020 21:00:03 +0200 |
parents | 73be82f278c0 |
children | d5ce7dd60dc1 |
comparison
equal
deleted
inserted
replaced
22517:6acf73cc1863 | 22518:81ae5fa92928 |
---|---|
2643 CheckUnix | 2643 CheckUnix |
2644 " Starting a terminal to run a shell in is considered flaky. | 2644 " Starting a terminal to run a shell in is considered flaky. |
2645 let g:test_is_flaky = 1 | 2645 let g:test_is_flaky = 1 |
2646 | 2646 |
2647 let origwin = win_getid() | 2647 let origwin = win_getid() |
2648 | |
2649 " open help window to test that :help below fails | |
2650 help | |
2651 | |
2648 let termbuf = term_start(&shell, #{hidden: 1}) | 2652 let termbuf = term_start(&shell, #{hidden: 1}) |
2649 let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10}) | 2653 let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10}) |
2650 " Wait for shell to start | 2654 " Wait for shell to start |
2651 call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))}) | 2655 call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))}) |
2652 sleep 100m | 2656 sleep 100m |
2664 call assert_fails('call feedkeys("gf", "xt")', 'E863:') | 2668 call assert_fails('call feedkeys("gf", "xt")', 'E863:') |
2665 call feedkeys("a\<C-U>", 'xt') | 2669 call feedkeys("a\<C-U>", 'xt') |
2666 | 2670 |
2667 " Cannot escape from terminal window | 2671 " Cannot escape from terminal window |
2668 call assert_fails('tab drop xxx', 'E863:') | 2672 call assert_fails('tab drop xxx', 'E863:') |
2673 call assert_fails('help', 'E994:') | |
2669 | 2674 |
2670 " Cannot open a second one. | 2675 " Cannot open a second one. |
2671 let termbuf2 = term_start(&shell, #{hidden: 1}) | 2676 let termbuf2 = term_start(&shell, #{hidden: 1}) |
2672 call assert_fails('call popup_create(termbuf2, #{})', 'E861:') | 2677 call assert_fails('call popup_create(termbuf2, #{})', 'E861:') |
2673 call term_sendkeys(termbuf2, "exit\<CR>") | 2678 call term_sendkeys(termbuf2, "exit\<CR>") |
2675 " Exiting shell closes popup window | 2680 " Exiting shell closes popup window |
2676 call feedkeys("exit\<CR>", 'xt') | 2681 call feedkeys("exit\<CR>", 'xt') |
2677 " Wait for shell to exit | 2682 " Wait for shell to exit |
2678 call WaitForAssert({-> assert_equal("dead", job_status(term_getjob(termbuf)))}) | 2683 call WaitForAssert({-> assert_equal("dead", job_status(term_getjob(termbuf)))}) |
2679 | 2684 |
2685 helpclose | |
2680 call feedkeys(":quit\<CR>", 'xt') | 2686 call feedkeys(":quit\<CR>", 'xt') |
2681 call assert_equal(origwin, win_getid()) | 2687 call assert_equal(origwin, win_getid()) |
2682 endfunc | 2688 endfunc |
2683 | 2689 |
2684 func Test_popupwin_close_prevwin() | 2690 func Test_popupwin_close_prevwin() |