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.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index 6fd58a1483..c9cd04018c 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -678,18 +678,24 @@ func Test_popup_and_window_resize()
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_wait(g:buf, 200)
call term_sendkeys(g:buf, "\<c-v>")
call term_wait(g:buf, 100)
+ " popup first entry "!" must be at the top
+ call WaitFor('term_getline(g:buf, 1) =~ "^!"')
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)')
+ " popup shifted down, first line is now empty
+ 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)')
+ " popup is below cursor line and shows first match "!"
+ 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))
+ " cursor line also shows !
+ call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0]))
bwipe!
endfunc