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
This commit is contained in:
TJ DeVries
2020-10-08 22:31:44 -04:00
parent 7938ace0f6
commit 59497d6640
6 changed files with 59 additions and 29 deletions

View File

@@ -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")