patch 8.0.1540: popup menu positioning fails with longer string
Problem: Popup menu positioning fails with longer string.
Solution: Only align with right side of window when width is less than
'pumwidth' (closes #2661)
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index b0024e6..499b08b 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -772,6 +772,15 @@
call term_sendkeys(buf, "GA\<C-N>")
call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8})
+ " completed text wider than the window and 'pumwidth' smaller than available
+ " space
+ call term_sendkeys(buf, "\<Esc>u")
+ call term_sendkeys(buf, ":set pumwidth=20\<CR>")
+ call term_sendkeys(buf, "ggI123456789_\<Esc>")
+ call term_sendkeys(buf, "jI123456789_\<Esc>")
+ call term_sendkeys(buf, "GA\<C-N>")
+ call VerifyScreenDump(buf, 'Test_popup_position_04', {'rows': 10})
+
call term_sendkeys(buf, "\<Esc>u")
call StopVimInTerminal(buf)
call delete('Xtest')