Skip to content

Commit

Permalink
Merge pull request #10 from AThePeanut4/revert-2020
Browse files Browse the repository at this point in the history
fix: revert #2020
  • Loading branch information
iguanacucumber authored Jan 8, 2025
2 parents af65502 + 363acba commit ca0d801
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 47 deletions.
42 changes: 0 additions & 42 deletions PRs/2020.patch

This file was deleted.

7 changes: 3 additions & 4 deletions lua/cmp/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ view.open = function(self, ctx, sources)
end

-- create filtered entries.
local max_view_entries = config.get().performance.max_view_entries or 200
local offset = ctx.cursor.col
local group_entries = {}
local max_item_counts = {}
Expand All @@ -97,9 +96,8 @@ view.open = function(self, ctx, sources)
-- source order priority bonus.
local priority = s:get_source_config().priority or ((#source_group - (i - 1)) * config.get().sorting.priority_weight)

local es = s:get_entries(ctx)
for index, e in ipairs(es) do
e.score = (e.score + priority) * max_view_entries + #es - index
for _, e in ipairs(s:get_entries(ctx)) do
e.score = e.score + priority
table.insert(group_entries, e)
offset = math.min(offset, e.offset)
end
Expand Down Expand Up @@ -130,6 +128,7 @@ view.open = function(self, ctx, sources)
end
end

local max_view_entries = config.get().performance.max_view_entries or 200
entries = vim.list_slice(entries, 1, max_view_entries)

-- open
Expand Down
1 change: 0 additions & 1 deletion merged.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
- fix missing required fields in formatting config [#2040](https://github.com/hrsh7th/nvim-cmp/pull/2040)
- fix(utils): Only call callback if type(callback) == "function" [#2038](https://github.com/hrsh7th/nvim-cmp/pull/2038)
- fix: the height of docs view get wrong when content lines get wrapped [#2032](https://github.com/hrsh7th/nvim-cmp/pull/2032)
- fix: The items within the view of Completion are in the wrong order. [#2020](https://github.com/hrsh7th/nvim-cmp/pull/2020)
- Keep empty lines when showing ghost_text [#2002](https://github.com/hrsh7th/nvim-cmp/pull/2002)
- fixup! fix: remove deprecated use of vim.tbl_add_reverse_lookup ([#1931](https://github.com/hrsh7th/nvim-cmp/pull/1931)) [#1991](https://github.com/hrsh7th/nvim-cmp/pull/1991)
- Fix misc.merge() [#1956](https://github.com/hrsh7th/nvim-cmp/pull/1956)
Expand Down

0 comments on commit ca0d801

Please sign in to comment.