aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_popup.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_popup.vim')
-rw-r--r--src/nvim/testdir/test_popup.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index 2191e3144f..6fd58a1483 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -1,5 +1,7 @@
" Test for completion menu
+source shared.vim
+
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
@@ -665,4 +667,30 @@ func Test_complete_CTRLN_startofbuffer()
bwipe!
endfunc
+func Test_popup_and_window_resize()
+ if !has('terminal') || has('gui_running')
+ return
+ endif
+ let h = winheight(0)
+ if h < 15
+ return
+ endif
+ let g:buf = term_start([$NVIM_PRG, '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3})
+ call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>G")
+ call term_sendkeys(g:buf, "i\<c-x>")
+ call term_wait(g:buf, 100)
+ call term_sendkeys(g:buf, "\<c-v>")
+ call term_wait(g:buf, 100)
+ call assert_match('^!\s*$', term_getline(g:buf, 1))
+ exe 'resize +' . (h - 1)
+ call term_wait(g:buf, 100)
+ redraw!
+ call WaitFor('"" == term_getline(g:buf, 1)')
+ call assert_equal('', term_getline(g:buf, 1))
+ sleep 100m
+ call WaitFor('"^!" =~ term_getline(g:buf, term_getcursor(g:buf)[0] + 1)')
+ call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab