feat: tiebreak config function (#1401)

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
Julian Fricker
2022-01-09 18:43:06 +00:00
committed by GitHub
parent e8ef88bfcb
commit 5060f3f0ab
5 changed files with 94 additions and 26 deletions

View File

@@ -74,6 +74,20 @@ telescope.setup({opts}) *telescope.setup()*
- "descending" (default)
- "ascending"
*telescope.defaults.tiebreak*
tiebreak: ~
A function that determines how to break a tie when two entries have
the same score.
Having a function that always returns false would keep the entries in
the order they are found, so existing_entry before current_entry.
Vice versa always returning true would place the current_entry
before the existing_entry.
Signature: function(current_entry, existing_entry, prompt) -> boolean
Default: function that breaks the tie based on the length of the
entry's ordinal
*telescope.defaults.selection_strategy*
selection_strategy: ~
Determines how the cursor acts after each sort iteration.