From 4abaf5a8701db77eb799d0014339dd0a94eaeca9 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Wed, 13 Oct 2021 08:06:20 +0200 Subject: [PATCH] Fix nvim-cmp sorter --- nvim/.config/nvim/fnl/dots/plugins/cmp.fnl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl b/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl index f8af042..00ff313 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/cmp.fnl @@ -23,7 +23,7 @@ : #(do (cmp.mapping.close) (vim.cmd "stopinsert")) : (cmp.mapping.confirm {:select true})} - ;:experimental {:custom_menu true} + :experimental {:custom_menu true} :sources [{:name "nvim_lsp" :priority 5} {:name "vsnip" :priority 3} @@ -35,9 +35,10 @@ :formatting {:format item-formatter} - :sorting {:comparators [#(do - ;(print ($1:get_kind) $1.completion_item.label "--" ($2:get_kind) $2.completion_item.label) - (if (= 15 ($1:get_kind)) false nil)) ; 15 means "SNIPPET", see https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua + :sorting {:comparators [#(do (if (and (= 15 ($1:get_kind)) (= 15 ($2:get_kind))) nil + (= 15 ($1:get_kind)) false + (= 15 ($2:get_kind)) true + nil)) ; 15 means "SNIPPET", see https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua cmp.config.compare.offset cmp.config.compare.exact cmp.config.compare.score