diff src/testdir/test_terminal.vim @ 22900:2c1520981e63 v8.2.1997

patch 8.2.1997: window changes when using bufload() while in a terminal popup Commit: https://github.com/vim/vim/commit/8adc8d9b73121b647476a33d91d31d25e1c2d987 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 16 20:47:31 2020 +0100 patch 8.2.1997: window changes when using bufload() while in a terminal popup Problem: Window changes when using bufload() while in a terminal popup. Solution: When searching for a window by ID also find a popup window. (closes #7307)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Nov 2020 21:00:04 +0100
parents be7f52838056
children 1bde09eef44a
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1237,6 +1237,23 @@ func Test_terminal_popup_with_cmd()
   unlet s:winid
 endfunc
 
+func Test_terminal_popup_bufload()
+  let termbuf = term_start(&shell, #{hidden: v:true, term_finish: 'close'})
+  let winid = popup_create(termbuf, {})
+  sleep 50m
+
+  let newbuf = bufadd('')
+  call bufload(newbuf)
+  call setbufline(newbuf, 1, 'foobar')
+
+  " must not have switched to another window
+  call assert_equal(winid, win_getid())
+
+  call feedkeys("exit\<CR>", 'xt')
+  sleep 50m
+  exe 'bwipe! ' .. newbuf
+endfunc
+
 func Test_terminal_popup_insert_cmd()
   CheckUnix