You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`headers`|`table?`| Help or information headers for the prompt interface. Can be a user-provided table or auto-generated based on `actions`. Header values can be represented as strings or function callback. |
782
-
|`match_limit`|`number?`| Maximum number of matches. `nil` means no limit. If a valid non nil number value is provided the fuzzy matching will stop the moment this number is reached. |
783
-
|`match_timer`|`number`| Time in milliseconds between processing matching result batches (useful for large result sets). |
784
-
|`match_step`|`number`| Number of entries to process in each matching step or batch (useful for large result sets). |
785
-
|`stream_map`|`function?`| Optional per-entry transform applied before entries are added to the stream. Return nil/false to skip an entry. |
786
-
|`stream_type`|`lines\|bytes`| Type of the stream content (`lines` splits on newlines, `bytes` splits on bytes, both are controller by the stream step size). |
787
-
|`stream_step`|`number`| Number of lines, or byte count to read per streaming step determining when to flush the stream items batch, based on the stream content type - lines or bytes. |
788
-
|`stream_debounce`|`number`| The time in milliseconds to debounce the flush calls of the stream, this is useful to avoid stream batch flushes in quick succession, when the results accumulate fast enough that we can combine into a single flush call instead, caused by the executable being too fast, or the `stream_step` being too small. |
789
-
|`window_size`|`number`| Ratio (0-1) specifying the picker window size relative to the screen. |
790
-
|`prompt_debounce`|`number`| Debounce time in ms to delay handling input (helps avoid overwhelming the matching process). |
791
-
|`prompt_query`|`string`| Initial user query for starting the picker prompt with. |
792
-
|`prompt_decor`|`string,table`| Prefix/suffix for the prompt. Can take the form of a string (just one) or a table (both) providing a table with `{ suffix = "", prefix = "" }` keys. |
|`headers`|`table?`| Help or information headers for the prompt interface. Can be a user-provided table or auto-generated based on `actions`. Header values can be represented as strings or function callback. |
784
+
|`match_limit`|`number?`| Maximum number of matches. `nil` means no limit. If a valid non nil number value is provided the fuzzy matching will stop the moment this number is reached. |
785
+
|`match_timer`|`number`| Time in milliseconds between processing matching result batches (useful for large result sets). |
786
+
|`match_step`|`number`| Number of entries to process in each matching step or batch (useful for large result sets). |
787
+
|`stream_map`|`function?`| Optional per-entry transform applied before entries are added to the stream. Return nil/false to skip an entry. |
788
+
|`stream_type`|`lines\|bytes`| Type of the stream content (`lines` splits on newlines, `bytes` splits on bytes, both are controller by the stream step size). |
789
+
|`stream_step`|`number`| Number of lines, or byte count to read per streaming step determining when to flush the stream items batch, based on the stream content type - lines or bytes. |
790
+
|`stream_debounce`|`number`| The time in milliseconds to debounce the matching work while a non-interactive picker stream is still producing entries and the user types in a query. As the stream accumulates, unchanged queries continue matching against new stream chunks instead of the complete stream, query changes trigger a debounced full re-match of everything seen thus far. When the query is empty, results are rendered directly without matching. |
791
+
|`window_size`|`number`| Ratio (0-1) specifying the picker window size relative to the screen. |
792
+
|`prompt_debounce`|`number`| Debounce time in ms to delay handling input (helps avoid overwhelming the matching process). |
793
+
|`prompt_query`|`string`| Initial user query for starting the picker prompt with. |
794
+
|`prompt_decor`|`string,table`| Prefix/suffix for the prompt. Can take the form of a string (just one) or a table (both) providing a table with `{ suffix = "", prefix = "" }` keys. |
793
795
794
796
### Option details
795
797
@@ -879,9 +881,16 @@ hl? }, { start, length, hl? } }`. The highlight start is automatically offset by
879
881
-**stream_step**: The number of lines/bytes to read per streaming step. This determines when to flush the stream batch. This is useful for
880
882
large data streams to avoid blocking the UI for too long.
881
883
882
-
-**stream_debounce**: The number of milliseconds between successive stream flush calls, can help if the `stream_step` is too small or the
883
-
executable is too fast and can accumulate `stream_step` entries into the stream fast enough that can cause the `matcher` to be overwhelmed,
884
-
by default it is set to 0, as for most use cases it is never really required.
884
+
-**stream_debounce**: This option only matters for non-interactive pickers while their stream is still alive and new entries are still
885
+
being accumulated. In that state there are three distinct behaviors. If the prompt query is empty, the picker does not fuzzy match at all
886
+
and simply renders the accumulated stream results directly. If the query is non-empty and has not changed since the last matching pass, the
887
+
picker continues incrementally matching only the newly arrived stream chunk and merges those matches into the running accumulated match
888
+
state. If the query changes while the stream is still producing entries, the previous incremental match state is no longer valid, so the
889
+
picker must re-match everything that has been streamed so far. `stream_debounce` controls that last case. Instead of immediately starting a
890
+
new full match every time the user changes the query while the stream is still growing, the picker waits for this debounce window and then
891
+
re-matches the complete accumulated result set once. This keeps rapid prompt edits from repeatedly restarting expensive full-list matching
892
+
work while the command is still emitting results. In other words, unchanged queries stay incremental, empty queries bypass matching
893
+
entirely, and changed queries are the only case that `stream_debounce` actually delays.
885
894
886
895
-**window_size**: The ratio (0-1) specifying the picker window size relative to the screen. A value of 0.5 means the picker will take up
887
896
half the screen. If the preview is enabled the picker will take up half that height, the rest will be used for the preview window.
Copy file name to clipboardExpand all lines: lua/fuzzy/match.lua
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,12 @@ function Match:_populate_chunks()
44
44
localsize=0
45
45
ifassert(self.list) and#self.list>0then
46
46
-- each time we are called we fill the chunks with the next step of items from the source list, the chunks are always the same size except for the last one which can be smaller.
0 commit comments