mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.2877: insufficient tests for popup menu rightleft
Problem: Insufficient tests for popup menu rightleft.
Solution: Add tests. (Yegappan Lakshmanan, closes vim/vim#8235)
1e615669c0
This commit is contained in:
parent
ca802046bf
commit
1b13c744ea
@ -1077,4 +1077,73 @@ func Test_pum_getpos()
|
|||||||
unlet g:pum_pos
|
unlet g:pum_pos
|
||||||
endfunc
|
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
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user