Skip to content

Commit

Permalink
fix(core): always only display max_view_entires
Browse files Browse the repository at this point in the history
fixes #103
  • Loading branch information
max397574 committed Oct 19, 2024
1 parent d360854 commit 7fcb63d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/care/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ function Core:complete(reason, source_filter)
return (a0.score or 0) > (a1.score or 0)
end)

entries = vim.iter(entries):take(require("care.config").options.max_view_entries):totable()

local opened_at = offset
if
opened_at == self.last_opened_at
and self.menu:is_open()
and self.context.cursor.row == self.context.previous.cursor.row
then
self.menu.entries =
vim.iter(entries):take(require("care.config").options.max_view_entries):totable()
self.menu.entries = entries
self.menu:readjust_win(offset)
else
self.menu:open(entries, offset)
Expand Down

0 comments on commit 7fcb63d

Please sign in to comment.