aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-01-01 16:40:28 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-07 17:20:49 +0000
commit960ea01972ad5fd291a846dce67f96a95222c310 (patch)
treeac010b9ca5e8550676e65df7242c86475a400360 /src/nvim/eval.lua
parentfba00b5e7ef2b6903a4588a2c080d8b33a8a2b68 (diff)
downloadrneovim-960ea01972ad5fd291a846dce67f96a95222c310.tar.gz
rneovim-960ea01972ad5fd291a846dce67f96a95222c310.tar.bz2
rneovim-960ea01972ad5fd291a846dce67f96a95222c310.zip
vim-patch:8.2.1726: fuzzy matching only works on strings
Problem: Fuzzy matching only works on strings. Solution: Support passing a dict. Add matchfuzzypos() to also get the match positions. (Yegappan Lakshmanan, closes vim/vim#6947) https://github.com/vim/vim/commit/4f73b8e9cc83f647b34002554a8bdf9abec0a82f Also remove some N/A and seemingly useless NULL checks -- Nvim allocs can't return NULL. I'm not sure why the retmatchpos stuff in match_fuzzy checks for NULL too, given that Vim checks for NULL alloc in do_fuzzymatch; assert that the li stuff is not NULL as that's the one check I'm ever-so-slightly unsure about. Adjust tests. Note that the text_cb tests actually throw E6000 in Nvim, but we also can't assert that error due to v8.2.1183 not being ported yet.
Diffstat (limited to 'src/nvim/eval.lua')
-rw-r--r--src/nvim/eval.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 37b051222e..6dedd0f745 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -249,7 +249,8 @@ return {
matcharg={args=1, base=1},
matchdelete={args={1, 2}, base=1},
matchend={args={2, 4}, base=1},
- matchfuzzy={args=2, base=1},
+ matchfuzzy={args={2, 3}, base=1},
+ matchfuzzypos={args={2, 3}, base=1},
matchlist={args={2, 4}, base=1},
matchstr={args={2, 4}, base=1},
matchstrpos={args={2,4}, base=1},