Skip to content

Commit

Permalink
fix: clamp maximum portals to available labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cbochs committed Mar 7, 2023
1 parent 7fed67a commit bb13e83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/portal/search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Search.open(results, labels, window_options)

local windows = {}

local max_index = math.max(unpack(vim.tbl_keys(results)))
local max_index = math.min(math.max(unpack(vim.tbl_keys(results))), #labels)
local cur_row = 0

for i = 1, max_index do
Expand Down

0 comments on commit bb13e83

Please sign in to comment.