patch 8.2.4848: local completion with mappings and simplification not working
Problem: Local completion with mappings and simplification not working.
Solution: Fix local completion <C-N>/<C-P> mappings not ignored if keys are
not simplified. (closes #10323)
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 5d04583..9832ccf 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -325,6 +325,21 @@
bwipe!
endfunc
+func Test_compl_ignore_mappings()
+ call setline(1, ['foo', 'bar', 'baz', 'foobar'])
+ inoremap <C-P> (C-P)
+ inoremap <C-N> (C-N)
+ normal! G
+ call feedkeys("o\<C-X>\<C-N>\<C-N>\<C-N>\<C-P>\<C-N>\<C-Y>", 'tx')
+ call assert_equal('baz', getline('.'))
+ " Also test with unsimplified keys
+ call feedkeys("o\<C-X>\<*C-N>\<*C-N>\<*C-N>\<*C-P>\<*C-N>\<C-Y>", 'tx')
+ call assert_equal('baz', getline('.'))
+ iunmap <C-P>
+ iunmap <C-N>
+ bwipe!
+endfunc
+
func DummyCompleteOne(findstart, base)
if a:findstart
return 0