summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-05-22 17:12:46 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-22 17:12:46 +0200
commit1e615669c0f1f4125001b2c01c30b00d8c68035e (patch)
tree940a488a0ed80f059b47ef98f00b968b47a6dc75
parent23c0192166760b0d73bd39252ca72e3cfe596f6e (diff)
downloadvim-git-1e615669c0f1f4125001b2c01c30b00d8c68035e.tar.gz
patch 8.2.2877: insufficient tests for popup menu rightleftv8.2.2877
Problem: Insufficient tests for popup menu rightleft. Solution: Add tests. (Yegappan Lakshmanan, closes #8235)
-rw-r--r--src/testdir/dumps/Test_pum_rightleft_01.dump8
-rw-r--r--src/testdir/dumps/Test_pum_rightleft_02.dump7
-rw-r--r--src/testdir/dumps/Test_pum_scrollbar_01.dump7
-rw-r--r--src/testdir/dumps/Test_pum_scrollbar_02.dump7
-rw-r--r--src/testdir/test_popup.vim69
-rw-r--r--src/version.c2
6 files changed, 100 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_pum_rightleft_01.dump b/src/testdir/dumps/Test_pum_rightleft_01.dump
new file mode 100644
index 000000000..8e8f6b4bc
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_rightleft_01.dump
@@ -0,0 +1,8 @@
+|w+0&#ffffff0|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a
+| @45|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x
+| @71|m|i|v
+| @67|y|r|o|t|c|i|v
+| @66> |y|r|o|t|c|i|v
+|w+0#0000001#ffd7ff255|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a|z|y|x|w|v|u|t|s|r|q|p|o|n|m|l|k|j|i|h|g|f|e|d|c|b|a
+| @71|m|i|v
+| +0&#e0e0e08@67|y|r|o|t|c|i|v
diff --git a/src/testdir/dumps/Test_pum_rightleft_02.dump b/src/testdir/dumps/Test_pum_rightleft_02.dump
new file mode 100644
index 000000000..0c658c06b
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_rightleft_02.dump
@@ -0,0 +1,7 @@
+| +0&#ffffff0@63|o|w|t| @4|e|n|o
+| @61|e@1|r|h|t| @4|e|n|o
+| @70|r|u|o|f
+| @60> |e@1|r|h|t| @4|e|n|o
+| +0#4040ff13&@59| +0#0000001#ffd7ff255@6|o|w|t| @1|e|n|o
+| +0#4040ff13#ffffff0@59| +0#0000001#e0e0e08@4|e@1|r|h|t| @1|e|n|o
+| +0#4040ff13#ffffff0@73|~
diff --git a/src/testdir/dumps/Test_pum_scrollbar_01.dump b/src/testdir/dumps/Test_pum_scrollbar_01.dump
new file mode 100644
index 000000000..af134d022
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_scrollbar_01.dump
@@ -0,0 +1,7 @@
+|o+0&#ffffff0|n|e| @71
+|t|w|o| @71
+|t|h|r|e@1| @69
+|o|n|e> @71
+|o+0#0000001#e0e0e08|n|e| @11| +0#0000000#0000001| +0#4040ff13#ffffff0@58
+|t+0#0000001#ffd7ff255|w|o| @11| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@58
+|~| @73
diff --git a/src/testdir/dumps/Test_pum_scrollbar_02.dump b/src/testdir/dumps/Test_pum_scrollbar_02.dump
new file mode 100644
index 000000000..1a462bc4e
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_scrollbar_02.dump
@@ -0,0 +1,7 @@
+| +0&#ffffff0@71|e|n|o
+| @71|o|w|t
+| @69|e@1|r|h|t
+| @70> |e|n|o
+| +0#4040ff13&@58| +0#0000000#0000001| +0#0000001#e0e0e08@11|e|n|o
+| +0#4040ff13#ffffff0@58| +0#0000000#a8a8a8255| +0#0000001#ffd7ff255@11|o|w|t
+| +0#4040ff13#ffffff0@73|~
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index c8f8820af..88aeafda7 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1145,4 +1145,73 @@ func Test_pum_getpos()
unlet g:pum_pos
endfunc
+" Test for the popup menu with the 'rightleft' option set
+func Test_pum_rightleft()
+ CheckScreendump
+ let lines =<< trim END
+ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+ vim
+ victory
+ END
+ call writefile(lines, 'Xtest1')
+ let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {})
+ call term_wait(buf)
+ call term_sendkeys(buf, "Go\<C-P>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8})
+ call term_sendkeys(buf, "\<C-P>\<C-Y>")
+ call term_wait(buf)
+ redraw!
+ call assert_match('\s*miv', Screenline(5))
+
+ " Test for expanding tabs to spaces in the popup menu
+ let lines =<< trim END
+ one two
+ one three
+ four
+ END
+ call writefile(lines, 'Xtest2')
+ call term_sendkeys(buf, "\<Esc>:e! Xtest2\<CR>")
+ call term_wait(buf)
+ call term_sendkeys(buf, "Goone\<C-X>\<C-L>")
+ call term_wait(buf)
+ redraw!
+ call VerifyScreenDump(buf, 'Test_pum_rightleft_02', {'rows': 7})
+ call term_sendkeys(buf, "\<C-Y>")
+ call term_wait(buf)
+ redraw!
+ call assert_match('\s*eerht eno', Screenline(4))
+
+ call StopVimInTerminal(buf)
+ call delete('Xtest1')
+ call delete('Xtest2')
+endfunc
+
+" Test for a popup menu with a scrollbar
+func Test_pum_scrollbar()
+ CheckScreendump
+ let lines =<< trim END
+ one
+ two
+ three
+ END
+ call writefile(lines, 'Xtest1')
+ let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {})
+ call term_wait(buf)
+ call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7})
+ call term_sendkeys(buf, "\<C-E>\<Esc>dd")
+ call term_wait(buf)
+
+ call term_sendkeys(buf, ":set rightleft\<CR>")
+ call term_wait(buf)
+ call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7})
+
+ call StopVimInTerminal(buf)
+ call delete('Xtest1')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index ca18b679f..82ecd0a93 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2877,
+/**/
2876,
/**/
2875,