patch 8.1.1523: cannot show range of buffer lines in popup window
Problem: Cannot show range of buffer lines in popup window.
Solution: Add the "firstline" property. (closes #4523)
diff --git a/src/testdir/dumps/Test_popupwin_firstline.dump b/src/testdir/dumps/Test_popupwin_firstline.dump
new file mode 100644
index 0000000..276f4e5
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_firstline.dump
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @73
+|2| @73
+|3| @73
+|4| @33|3+0#0000001#ffd7ff255@4| +0#0000000#ffffff0@34
+|5| @33|4+0#0000001#ffd7ff255@1| @2| +0#0000000#ffffff0@34
+|6| @33|5+0#0000001#ffd7ff255| @3| +0#0000000#ffffff0@34
+|7| @33|6+0#0000001#ffd7ff255@4| +0#0000000#ffffff0@34
+|8| @73
+|9| @73
+@57|1|,|1| @10|T|o|p|
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 9afd840..6def8e4 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -269,6 +269,26 @@
call delete('XtestPopupCorners')
endfunc
+func Test_popup_firstline()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+ let lines =<< trim END
+ call setline(1, range(1, 20))
+ call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], {
+ \ 'maxheight': 4,
+ \ 'firstline': 3,
+ \ })
+ END
+ call writefile(lines, 'XtestPopupFirstline')
+ let buf = RunVimInTerminal('-S XtestPopupFirstline', {'rows': 10})
+ call VerifyScreenDump(buf, 'Test_popupwin_firstline', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupFirstline')
+endfunc
+
func Test_popup_in_tab()
" default popup is local to tab, not visible when in other tab
let winid = popup_create("text", {})