diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-08 13:43:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-08 13:43:10 +0100 |
commit | 58a3cae3eb590c375bf4823052e8d9d4165050de (patch) | |
tree | f93146c40253fe4f8f6953f3ee357138dcfcf071 /src/testdir/test_popupwin.vim | |
parent | 0500e87eba7b2a82392dbb5d573de19f8ff138e7 (diff) | |
download | vim-git-58a3cae3eb590c375bf4823052e8d9d4165050de.tar.gz |
patch 9.0.0416: ml_get error when appending lines in popup windowv9.0.0416
Problem: ml_get error when appending lines in popup window.
Solution: Only update w_topline when w_buffer matches curbuf.
(closes #11074)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r-- | src/testdir/test_popupwin.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 7cdd12865..5230fa3e1 100644 --- 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 |