fix: cycle scroll when num_results is small (#316)
This commit is contained in:
@@ -696,10 +696,18 @@ end
|
||||
|
||||
function Picker:_handle_scroll_strategy(row)
|
||||
if self.scroll_strategy == "cycle" then
|
||||
if row >= self.max_results then
|
||||
row = 0
|
||||
elseif row < 0 then
|
||||
row = self.max_results - 1
|
||||
if self.max_results > self.manager:num_results() then
|
||||
if row < self.max_results - self.manager:num_results() then
|
||||
row = self.max_results - 1
|
||||
elseif row > self.max_results - 1 then
|
||||
row = self.max_results - self.manager:num_results()
|
||||
end
|
||||
else
|
||||
if row >= self.max_results then
|
||||
row = 0
|
||||
elseif row < 0 then
|
||||
row = self.max_results - 1
|
||||
end
|
||||
end
|
||||
else
|
||||
if row >= self.max_results then
|
||||
|
||||
Reference in New Issue
Block a user