diff src/testdir/test_bufline.vim @ 31255:87ff5e71d3c2 v9.0.0961

patch 9.0.0961: using deletebufline() may jump to another window Commit: https://github.com/vim/vim/commit/3da8597fc07505c0f8839b0834aafe1c10ffb456 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 27 19:45:49 2022 +0000 patch 9.0.0961: using deletebufline() may jump to another window Problem: Using deletebufline() may jump to another window. Solution: Do not use a window where the buffer was only in the past. (closes #11594)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Nov 2022 21:00:05 +0100
parents 7831da568864
children
line wrap: on
line diff
--- a/src/testdir/test_bufline.vim
+++ b/src/testdir/test_bufline.vim
@@ -288,6 +288,20 @@ func Test_deletebufline_select_mode()
   bwipe!
 endfunc
 
+func Test_deletebufline_popup_window()
+  let popupID = popup_create('foo', {})
+  let bufnr = winbufnr(popupID)
+
+  " Check that deletebufline() brings us back to the same window.
+  new
+  let winid_before = win_getid()
+  call deletebufline(bufnr, 1, '$')
+  call assert_equal(winid_before, win_getid())
+  bwipe
+
+  call popup_close(popupID)
+endfunc
+
 func Test_setbufline_startup_nofile()
   let before =<< trim [CODE]
     set shortmess+=F