mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:9.1.1594: completion: search completion throws errors (#35198)
Problem: completion: search completion throws errors, wrong placement
of pum menu with 'imi'=1 (berggeist)
Solution: Fix those errors (Girish Palya)
fixes: vim/vim#17858
closes: vim/vim#17870
66467cf5d8
Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
@@ -486,6 +486,43 @@ describe('cmdline', function()
|
||||
|
||||
feed('<esc>')
|
||||
end)
|
||||
|
||||
-- oldtest: Test_search_wildmenu_iminsert()
|
||||
it('search wildmenu pum with iminsert=1', function()
|
||||
local screen = Screen.new(65, 20)
|
||||
exec([[
|
||||
set wop=pum imi=1
|
||||
setlocal iskeyword=!-~,192-255
|
||||
call setline(1, [
|
||||
\ " global toggle global-local global/local glyphs toggles English",
|
||||
\ "accordingly. toggled accordingly single-byte glob() glob(pat,",
|
||||
\ "English, 'gli' global-ime single-repeat 'toggle' 'toggle'.",
|
||||
\ ])
|
||||
]])
|
||||
feed('/gl<Tab>')
|
||||
screen:expect([[
|
||||
{12: global }lobal-local global/local glyphs toggles English |
|
||||
{4: gle }gled accordingly single-byte glob() glob(pat, |
|
||||
{4: global-local }lobal-ime single-repeat 'toggle' 'toggle'. |
|
||||
{4: global/local }{1: }|
|
||||
{4: glyphs }{1: }|
|
||||
{4: gles }{1: }|
|
||||
{4: glish }{1: }|
|
||||
{4: gly. }{1: }|
|
||||
{4: gled }{1: }|
|
||||
{4: gly }{1: }|
|
||||
{4: gle-byte }{1: }|
|
||||
{4: glob() }{1: }|
|
||||
{4: glob(pat, }{1: }|
|
||||
{4: glish, }{1: }|
|
||||
{4: gli' }{1: }|
|
||||
{4: global-ime }{1: }|
|
||||
{4: gle-repeat }{1: }|
|
||||
{4: gle' }{1: }|
|
||||
{4: gle'. }{1: }|
|
||||
/global^ |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('cmdwin', function()
|
||||
|
@@ -4592,11 +4592,19 @@ func Test_search_complete()
|
||||
call feedkeys("gg/r\\n.*\\n\<tab>\<f9>", 'tx')
|
||||
call assert_equal(['r\nFoobar\nfooBAr', 'r\nfooBAr\nFooBARR'], g:compl_info.matches)
|
||||
|
||||
" Issue #17858
|
||||
%d
|
||||
set wildcharm=0 incsearch& ignorecase& smartcase& wildoptions&
|
||||
setlocal iskeyword=!-~,192-255
|
||||
let l:lines = ['th=~/foo', 'these', 'tho']
|
||||
call setline(1, l:lines)
|
||||
call feedkeys("G/th\<tab>\<f9>", 'tx')
|
||||
call assert_equal(l:lines, g:compl_info.matches)
|
||||
|
||||
bw!
|
||||
call Ntest_override("char_avail", 0)
|
||||
delfunc GetComplInfo
|
||||
unlet! g:compl_info
|
||||
set wildcharm=0 incsearch& ignorecase& smartcase& wildoptions&
|
||||
endfunc
|
||||
|
||||
func Test_search_wildmenu_screendump()
|
||||
@@ -4647,6 +4655,25 @@ func Test_search_wildmenu_screendump()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Issue #17858
|
||||
func Test_search_wildmenu_iminsert()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim [SCRIPT]
|
||||
set wop=pum imi=1
|
||||
h wildoptions
|
||||
[SCRIPT]
|
||||
call writefile(lines, 'XTest_search_wildmenu', 'D')
|
||||
let buf = RunVimInTerminal('-S XTest_search_wildmenu', {'rows': 20})
|
||||
|
||||
call term_sendkeys(buf, "/gl\<Tab>")
|
||||
call TermWait(buf, 50)
|
||||
call VerifyScreenDump(buf, 'Test_search_wildmenu_iminsert', {})
|
||||
|
||||
call term_sendkeys(buf, "\<esc>")
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test wildcharm completion for :s and :g with range
|
||||
func Test_range_complete()
|
||||
set wildcharm=<c-z>
|
||||
|
Reference in New Issue
Block a user