summaryrefslogtreecommitdiff
path: root/lua/telescope/config.lua
diff options
context:
space:
mode:
authorJulian Fricker <402357+TC72@users.noreply.github.com>2022-01-09 18:43:06 +0000
committerGitHub <noreply@github.com>2022-01-09 19:43:06 +0100
commit5060f3f0ab33504e728a8673dc08679947c35ded (patch)
treeadc649dd91bb4131da32c3da647c8a81175470c4 /lua/telescope/config.lua
parente8ef88bfcbabde42b7a29e938dc5ebbdbb8b1c5f (diff)
feat: tiebreak config function (#1401)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/config.lua')
-rw-r--r--lua/telescope/config.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua
index 043ac8a..5bf8602 100644
--- a/lua/telescope/config.lua
+++ b/lua/telescope/config.lua
@@ -154,6 +154,25 @@ append(
)
append(
+ "tiebreak",
+ function(current_entry, existing_entry, _)
+ return #current_entry.ordinal < #existing_entry.ordinal
+ end,
+ [[
+ 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]]
+)
+
+append(
"selection_strategy",
"reset",
[[