summaryrefslogtreecommitdiff
path: root/lua/telescope/entry_manager.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/entry_manager.lua
parente8ef88bfcbabde42b7a29e938dc5ebbdbb8b1c5f (diff)
feat: tiebreak config function (#1401)
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/entry_manager.lua')
-rw-r--r--lua/telescope/entry_manager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/telescope/entry_manager.lua b/lua/telescope/entry_manager.lua
index 1e94c80..a8331e4 100644
--- a/lua/telescope/entry_manager.lua
+++ b/lua/telescope/entry_manager.lua
@@ -105,7 +105,7 @@ function EntryManager:_append_container(picker, new_container, should_update)
end
end
-function EntryManager:add_entry(picker, score, entry)
+function EntryManager:add_entry(picker, score, entry, prompt)
score = score or 0
local max_res = self.max_results
@@ -137,7 +137,7 @@ function EntryManager:add_entry(picker, score, entry)
return self:_insert_container_before(picker, index, node, new_container)
end
- if score < 1 and container[2] == score and #entry.ordinal < #container[1].ordinal then
+ if score < 1 and container[2] == score and picker.tiebreak(entry, container[1], prompt) then
return self:_insert_container_before(picker, index, node, new_container)
end