diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2022-04-16 12:35:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-16 12:35:35 +0100 |
commit | 9029a6e9931eede1d44f613687a2c01b9fe514ec (patch) | |
tree | aacb7d7a0207d4ba70e62c9debe24d3e2590e43f /runtime | |
parent | 693ccd11606b59eb0f81c6c1948679e61ada4022 (diff) |
patch 8.2.4760: using matchfuzzy() on a long list can take a whilev8.2.4760
Problem: Using matchfuzzy() on a long list can take a while.
Solution: Add a limit to the number of matches. (Yasuhiro Matsumoto,
closes #10189)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index f6a791d9fa..e99a81302a 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -5581,7 +5581,7 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* If {list} is a list of dictionaries, then the optional {dict} argument supports the following additional items: - key key of the item which is fuzzy matched against + key Key of the item which is fuzzy matched against {str}. The value of this item should be a string. text_cb |Funcref| that will be called for every item @@ -5589,6 +5589,8 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* This should accept a dictionary item as the argument and return the text for that item to use for fuzzy matching. + limit Maximum number of matches in {list} to be + returned. Zero means no limit. {str} is treated as a literal string and regular expression matching is NOT supported. The maximum supported {str} length @@ -5601,6 +5603,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* empty list is returned. If length of {str} is greater than 256, then returns an empty list. + When {limit} is given, matchfuzzy() will find up to this + number of matches in {list} and return them in sorted order. + Refer to |fuzzy-matching| for more information about fuzzy matching strings. |