diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-01 21:25:41 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-07 17:20:50 +0000 |
commit | 30deb14f397e576aedfa54600ed7408b3e03459d (patch) | |
tree | a266fff8721e9f73eac9017cd5615fe6b5c6f20b /runtime | |
parent | 8313d31e4a5065ac0e945ebc689fa083a50e41dc (diff) | |
download | rneovim-30deb14f397e576aedfa54600ed7408b3e03459d.tar.gz rneovim-30deb14f397e576aedfa54600ed7408b3e03459d.tar.bz2 rneovim-30deb14f397e576aedfa54600ed7408b3e03459d.zip |
vim-patch:8.2.1893: fuzzy matching does not support multiple words
Problem: Fuzzy matching does not support multiple words.
Solution: Add support for matching white space separated words. (Yegappan
Lakshmanan, closes vim/vim#7163)
https://github.com/vim/vim/commit/8ded5b647aa4b3338da721b343e0bce0f86655f6
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 14cf9f09fc..745f1d9116 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -4866,8 +4866,15 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* the strings in {list} that fuzzy match {str}. The strings in the returned list are sorted based on the matching score. + The optional {dict} argument always supports the following + items: + matchseq When this item is present and {str} contains + multiple words separated by white space, then + returns only matches that contain the words in + the given sequence. + If {list} is a list of dictionaries, then the optional {dict} - argument supports the following items: + argument supports the following additional items: key key of the item which is fuzzy matched against {str}. The value of this item should be a string. @@ -4881,6 +4888,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* matching is NOT supported. The maximum supported {str} length is 256. + When {str} has multiple words each separated by white space, + then the list of strings that have all the words is returned. + If there are no matching strings or there is an error, then an empty list is returned. If length of {str} is greater than 256, then returns an empty list. @@ -4900,7 +4910,12 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* :echo v:oldfiles->matchfuzzy("test") < results in a list of file names fuzzy matching "test". > :let l = readfile("buffer.c")->matchfuzzy("str") -< results in a list of lines in "buffer.c" fuzzy matching "str". +< results in a list of lines in "buffer.c" fuzzy matching "str". > + :echo ['one two', 'two one']->matchfuzzy('two one') +< results in ['two one', 'one two']. > + :echo ['one two', 'two one']->matchfuzzy('two one', + \ {'matchseq': 1}) +< results in ['two one']. matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* Same as |matchfuzzy()|, but returns the list of matched |