summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-10-08 22:31:44 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-10-08 22:31:44 -0400
commit59497d664086c4c7aa24a15a1c3b9ccf718ce9c7 (patch)
treefc418ff9dbfd96579ccb897c0f15f47c19894bb6 /lua/telescope/pickers.lua
parent7938ace0f6681e5bd5207283036b496416879c67 (diff)
feat: Do a bit better sorting for command history
To be honest, I'm not 100% sure this is fantastic, but it's definitely a step in the right direction for command history. Closes: #150
Diffstat (limited to 'lua/telescope/pickers.lua')
-rw-r--r--lua/telescope/pickers.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index f28ae6a..3dc0caa 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -741,7 +741,7 @@ function Picker:set_selection(row)
end
-function Picker:entry_adder(index, entry)
+function Picker:entry_adder(index, entry, score)
local row = self:get_row(index)
-- If it's less than 0, then we don't need to show it at all.
@@ -764,7 +764,11 @@ function Picker:entry_adder(index, entry)
-- This is the two spaces to manage the '> ' stuff.
-- Maybe someday we can use extmarks or floaty text or something to draw this and not insert here.
-- until then, insert two spaces
- display = ' ' .. display
+ if TELESCOPE_DEBUG then
+ display = ' ' .. score .. display
+ else
+ display = ' ' .. display
+ end
self:_increment("displayed")