comparison src/testdir/test_popup.vim @ 13329:424321d6eea7 v8.0.1539

patch 8.0.1539: no test for the popup menu positioning commit https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 24 19:53:53 2018 +0100 patch 8.0.1539: no test for the popup menu positioning Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu.
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Feb 2018 20:00:07 +0100
parents ae5f855a64be
children 1ba4f926247c
comparison
equal deleted inserted replaced
13328:2c639a9a4def 13329:424321d6eea7
1 " Test for completion menu 1 " Test for completion menu
2 2
3 source shared.vim 3 source shared.vim
4 source screendump.vim
4 5
5 let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] 6 let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
6 let g:setting = '' 7 let g:setting = ''
7 8
8 func! ListMonths() 9 func! ListMonths()
741 \ ' next = 123}', 742 \ ' next = 123}',
742 \ ], balloon_split( 743 \ ], balloon_split(
743 \ 'struct = 0x234 {long = 2343 "\\"some long string that will be wrapped in two\\"", next = 123}')) 744 \ 'struct = 0x234 {long = 2343 "\\"some long string that will be wrapped in two\\"", next = 123}'))
744 endfunc 745 endfunc
745 746
747 func Test_popup_position()
748 if !CanRunVimInTerminal()
749 return
750 endif
751 call writefile([
752 \ '123456789_123456789_123456789_a',
753 \ '123456789_123456789_123456789_b',
754 \ ' 123',
755 \ ], 'Xtest')
756 let buf = RunVimInTerminal('Xtest', {})
757 call term_sendkeys(buf, ":vsplit\<CR>")
758
759 " default pumwidth in left window: overlap in right window
760 call term_sendkeys(buf, "GA\<C-N>")
761 call VerifyScreenDump(buf, 'Test_popup_position_01', {'rows': 8})
762 call term_sendkeys(buf, "\<Esc>u")
763
764 " default pumwidth: fill until right of window
765 call term_sendkeys(buf, "\<C-W>l")
766 call term_sendkeys(buf, "GA\<C-N>")
767 call VerifyScreenDump(buf, 'Test_popup_position_02', {'rows': 8})
768
769 " larger pumwidth: used as minimum width
770 call term_sendkeys(buf, "\<Esc>u")
771 call term_sendkeys(buf, ":set pumwidth=30\<CR>")
772 call term_sendkeys(buf, "GA\<C-N>")
773 call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8})
774
775 call term_sendkeys(buf, "\<Esc>u")
776 call StopVimInTerminal(buf)
777 call delete('Xtest')
778 endfunc
779
746 " vim: shiftwidth=2 sts=2 expandtab 780 " vim: shiftwidth=2 sts=2 expandtab