]> granicus.if.org Git - vim/commitdiff
patch 8.2.1807: can use :help in a terminal popup window v8.2.1807
authorBram Moolenaar <Bram@vim.org>
Tue, 6 Oct 2020 18:46:49 +0000 (20:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 6 Oct 2020 18:46:49 +0000 (20:46 +0200)
Problem:    Can use :help in a terminal popup window.
Solution:   Give an error. (closes #7088)

src/help.c
src/testdir/test_popupwin.vim
src/version.c

index 4f2b6b69e0301252bc7a3bc278c46fd7a14609b2..4d59ab90e1a333dac66de89a2a029a3073e69986 100644 (file)
@@ -39,6 +39,9 @@ ex_help(exarg_T *eap)
     int                old_KeyTyped = KeyTyped;
 #endif
 
+    if (ERROR_IF_ANY_POPUP_WINDOW)
+       return;
+
     if (eap != NULL)
     {
        // A ":help" command ends at the first LF, or at a '|' that is
index e991fc116f25a9ba3f84ef73018a7aa37265f776..187b4f13eb213f56c6c974a1acc705602a91b455 100644 (file)
@@ -2645,6 +2645,10 @@ func Test_popupwin_terminal_buffer()
   let g:test_is_flaky = 1
 
   let origwin = win_getid()
+
+  " open help window to test that :help below fails
+  help
+
   let termbuf = term_start(&shell, #{hidden: 1})
   let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10})
   " Wait for shell to start
@@ -2666,6 +2670,7 @@ func Test_popupwin_terminal_buffer()
 
   " Cannot escape from terminal window
   call assert_fails('tab drop xxx', 'E863:')
+  call assert_fails('help', 'E994:')
 
   " Cannot open a second one.
   let termbuf2 = term_start(&shell, #{hidden: 1})
@@ -2677,6 +2682,7 @@ func Test_popupwin_terminal_buffer()
   " Wait for shell to exit
   call WaitForAssert({-> assert_equal("dead", job_status(term_getjob(termbuf)))})
 
+  helpclose
   call feedkeys(":quit\<CR>", 'xt')
   call assert_equal(origwin, win_getid())
 endfunc
index a410167bebc92813a748c1eb86841d6d369f4d2d..daac37215c728c027f54535d139bea8ee7a28b2d 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1807,
 /**/
     1806,
 /**/