diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-06-18 13:43:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-18 13:43:02 +0800 |
| commit | 966d55effe5cbfc3d779c89591a1bec4e9ac6639 (patch) | |
| tree | c210dc14c8fcbd578ed543b83ec4a1b3e9e739e9 /src/nvim/testdir | |
| parent | e651ae5864503d219134c7c0124bff6bd9a663f7 (diff) | |
| download | rneovim-966d55effe5cbfc3d779c89591a1bec4e9ac6639.tar.gz rneovim-966d55effe5cbfc3d779c89591a1bec4e9ac6639.tar.bz2 rneovim-966d55effe5cbfc3d779c89591a1bec4e9ac6639.zip | |
vim-patch:8.2.5116: "limit" option of matchfuzzy() not always respected (#19005)
Problem: "limit" option of matchfuzzy() not always respected.
Solution: Remove "else". (Kazuyuki Miyagi, closes vim/vim#10586)
https://github.com/vim/vim/commit/47f1a55849a73cefe738a246798221e45448546a
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_matchfuzzy.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_matchfuzzy.vim b/src/nvim/testdir/test_matchfuzzy.vim index 533aec8d9a..6b4949ad8c 100644 --- a/src/nvim/testdir/test_matchfuzzy.vim +++ b/src/nvim/testdir/test_matchfuzzy.vim @@ -258,6 +258,14 @@ func Test_matchfuzzy_limit() call assert_equal(['2', '2'], x->matchfuzzy('2', #{limit: 2})) call assert_equal(['2', '2'], x->matchfuzzy('2', #{limit: 3})) call assert_fails("call matchfuzzy(x, '2', #{limit: '2'})", 'E475:') + + let l = [{'id': 5, 'val': 'crayon'}, {'id': 6, 'val': 'camera'}] + call assert_equal([{'id': 5, 'val': 'crayon'}, {'id': 6, 'val': 'camera'}], l->matchfuzzy('c', #{text_cb: {v -> v.val}})) + call assert_equal([{'id': 5, 'val': 'crayon'}, {'id': 6, 'val': 'camera'}], l->matchfuzzy('c', #{key: 'val'})) + call assert_equal([{'id': 5, 'val': 'crayon'}, {'id': 6, 'val': 'camera'}], l->matchfuzzy('c', #{text_cb: {v -> v.val}, limit: 0})) + call assert_equal([{'id': 5, 'val': 'crayon'}, {'id': 6, 'val': 'camera'}], l->matchfuzzy('c', #{key: 'val', limit: 0})) + call assert_equal([{'id': 5, 'val': 'crayon'}], l->matchfuzzy('c', #{text_cb: {v -> v.val}, limit: 1})) + call assert_equal([{'id': 5, 'val': 'crayon'}], l->matchfuzzy('c', #{key: 'val', limit: 1})) endfunc " vim: shiftwidth=2 sts=2 expandtab |