mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +00:00
vim-patch:9.1.1810: completion: "longest" doesn't work for manual completion with 'ac'
Problem: completion: "longest" doesn't work for manual completion when
'autocomplete' is on (after 9.1.1800).
Solution: Only reset compl_get_longest when enabling autocompletion
(zeertzjq).
closes: vim/vim#18430
b3966d6a8e
This commit is contained in:
@@ -5984,7 +5984,7 @@ func Test_autocomplete_longest()
|
||||
call feedkeys("Go\<ESC>", 'tx')
|
||||
call DoTest("f\<C-N>\<C-N>\<BS>\<BS>\<BS>\<BS>", 'foo', 3)
|
||||
|
||||
" Issue #18410: When both 'preinsert' and 'longest' are set, 'preinsert'
|
||||
" Issue #18410: When both "preinsert" and "longest" are set, "preinsert"
|
||||
" takes precedence
|
||||
%delete
|
||||
set autocomplete completeopt+=longest,preinsert
|
||||
@@ -6035,6 +6035,21 @@ func Test_autocomplete_longest()
|
||||
%delete _
|
||||
delfunc CheckUndo
|
||||
|
||||
" Check that behavior of "longest" in manual completion is unchanged.
|
||||
for ac in [v:false, v:true]
|
||||
let &ac = ac
|
||||
set completeopt=menuone,longest
|
||||
call feedkeys("Ssign u\<C-X>\<C-V>", 'tx')
|
||||
call assert_equal('sign un', getline('.'))
|
||||
call feedkeys("Ssign u\<C-X>\<C-V>\<C-V>", 'tx')
|
||||
call assert_equal('sign undefine', getline('.'))
|
||||
call feedkeys("Ssign u\<C-X>\<C-V>\<C-V>\<C-V>", 'tx')
|
||||
call assert_equal('sign unplace', getline('.'))
|
||||
call feedkeys("Ssign u\<C-X>\<C-V>\<C-V>\<C-V>\<C-V>", 'tx')
|
||||
call assert_equal('sign u', getline('.'))
|
||||
%delete
|
||||
endfor
|
||||
|
||||
bw!
|
||||
set cot& autocomplete&
|
||||
delfunc GetLine
|
||||
|
Reference in New Issue
Block a user