diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-08-30 16:42:38 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-27 07:26:42 +0800 |
commit | d9f4c1db23bff997ec2f568b378c2666fa580ad7 (patch) | |
tree | 7bf1df1bed3e20192c6a5545f0dc099e06415b3e | |
parent | 9757b11aaf58cf49b96daa3abe31af2212badbe1 (diff) | |
download | rneovim-d9f4c1db23bff997ec2f568b378c2666fa580ad7.tar.gz rneovim-d9f4c1db23bff997ec2f568b378c2666fa580ad7.tar.bz2 rneovim-d9f4c1db23bff997ec2f568b378c2666fa580ad7.zip |
vim-patch:9.1.0634: Ctrl-P not working by default
Problem: Ctrl-P not working by default
(Jesse Pavel, after v9.1.0598)
Solution: Revert part of v9.1.0598 and set cur_match_pos
correctly according to compl_dir_forward()
fixes: vim/vim#15370
closes: vim/vim#15379
https://github.com/vim/vim/commit/13032a49b7d2a45e7c774cf23ee8f58f56b03781
Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | src/nvim/insexpand.c | 6 | ||||
-rw-r--r-- | test/old/testdir/test_ins_complete.vim | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 4cddebf3f9..15ece1cab8 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3746,11 +3746,7 @@ static int ins_compl_get_exp(pos_T *ini) assert(st.ins_buf != NULL); compl_old_match = compl_curr_match; // remember the last current match - if (in_fuzzy) { - st.cur_match_pos = compl_dir_forward() ? &st.last_match_pos : &st.first_match_pos; - } else { - st.cur_match_pos = &st.last_match_pos; - } + st.cur_match_pos = compl_dir_forward() ? &st.last_match_pos : &st.first_match_pos; // For ^N/^P loop over all the flags/windows/buffers in 'complete' while (true) { diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index 381a69dd41..0b1a1bed47 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2986,6 +2986,16 @@ func Test_complete_fuzzy_match_tie() set completeopt& endfunc +func Test_complete_backwards_default() + new + call append(1, ['foobar', 'foobaz']) + new + call feedkeys("i\<c-p>", 'tx') + call assert_equal('foobaz', getline('.')) + bw! + bw! +endfunc + func Test_complete_info_matches() let g:what = ['matches'] func ShownInfo() |