Skip to content

Commit

Permalink
fix(finder): followup to #2442, make sure entry is not nil (#2526)
Browse files Browse the repository at this point in the history
(cherry picked from commit 19e8a8a)
  • Loading branch information
Conni2461 committed May 24, 2023
1 parent be8d87b commit 66390a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lua/telescope/finders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ function JobFinder:_find(prompt, process_result, process_complete)
local entry
if self.entry_maker then
entry = self.entry_maker(line)
entry.index = line_num
if entry then
entry.index = line_num
end
else
entry = line
end
Expand Down Expand Up @@ -141,7 +143,9 @@ function DynamicFinder:_find(prompt, process_result, process_complete)
for _, result in ipairs(results) do
result_num = result_num + 1
local entry = self.entry_maker(result)
entry.index = result_num
if entry then
entry.index = result_num
end
if process_result(entry) then
return
end
Expand Down
4 changes: 3 additions & 1 deletion lua/telescope/finders/async_job_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ return function(opts)
for line in stdout:iter(true) do
line_num = line_num + 1
local entry = entry_maker(line)
entry.index = line_num
if entry then
entry.index = line_num
end
if process_result(entry) then
return
end
Expand Down
4 changes: 3 additions & 1 deletion lua/telescope/finders/async_oneshot_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ return function(opts)
end

local entry = entry_maker(line)
entry.index = num_results
if entry then
entry.index = num_results
end
results[num_results] = entry
process_result(entry)
end
Expand Down

0 comments on commit 66390a6

Please sign in to comment.