diff src/testdir/test_popupwin.vim @ 30160:fbf6084346cc v9.0.0416

patch 9.0.0416: ml_get error when appending lines in popup window Commit: https://github.com/vim/vim/commit/58a3cae3eb590c375bf4823052e8d9d4165050de Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 8 13:43:10 2022 +0100 patch 9.0.0416: ml_get error when appending lines in popup window Problem: ml_get error when appending lines in popup window. Solution: Only update w_topline when w_buffer matches curbuf. (closes #11074)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Sep 2022 14:45:09 +0200
parents 13b02c1ea0f7
children 457ea0570b6f
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -4174,5 +4174,28 @@ func Test_bufdel_skips_popupwin_buffer()
     call popup_close(id)
 endfunc
 
+func Test_term_popup_bufline()
+  " very specific situation where a non-existing buffer line is used, leading
+  " to an ml_get error
+  CheckScreendump
+
+  let lines =<< trim END
+      vim9script
+      &scrolloff = 5
+      term_start('seq 1 5', {term_finish: 'open'})
+      timer_start(50, (_) => {
+	  set cpoptions&vim
+	  var buf = popup_create([], {})->winbufnr()
+	  appendbufline(buf, 0, range(5))
+      })
+  END
+  call writefile(lines, 'XtestTermPopup', 'D')
+  let buf = RunVimInTerminal('-S XtestTermPopup', #{rows: 15})
+  call VerifyScreenDump(buf, 'Test_term_popup_bufline', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+endfunc
+
 
 " vim: shiftwidth=2 sts=2