summaryrefslogtreecommitdiff
path: root/lua/telescope/finders.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/finders.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/finders.lua')
-rw-r--r--lua/telescope/finders.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/lua/telescope/finders.lua b/lua/telescope/finders.lua
index a9222e7..a3ca097 100644
--- a/lua/telescope/finders.lua
+++ b/lua/telescope/finders.lua
@@ -33,7 +33,7 @@ local JobFinder = _callable_obj()
function JobFinder:new(opts)
opts = opts or {}
- assert(not opts.results, "`results` should be used with finder.new_table")
+> assert(not opts.results, "`results` should be used with finder.new_table")
assert(not opts.static, "`static` should be used with finder.new_oneshot_job")
local obj = setmetatable({
@@ -238,8 +238,11 @@ function StaticFinder:new(opts)
assert(type(input_results) == 'table', "self.results must be a table")
local results = {}
- for _, v in ipairs(input_results) do
- table.insert(results, entry_maker(v))
+ for k, v in ipairs(input_results) do
+ local entry = entry_maker(v)
+ entry.index = k
+
+ table.insert(results, entry)
end
return setmetatable({ results = results }, self)