|
@@ -252,6 +252,16 @@ require('treesj').setup({
|
|
|
-- completion
|
|
|
local cmp = require('cmp')
|
|
|
local cmp_types = require('cmp.types')
|
|
|
+
|
|
|
+function sort_label(entry1, entry2)
|
|
|
+ local diff = vim.stricmp(entry1.completion_item.label, entry2.completion_item.label)
|
|
|
+ if diff < 0 then
|
|
|
+ return true
|
|
|
+ elseif diff > 0 then
|
|
|
+ return false
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
cmp.setup({
|
|
|
snippet = {
|
|
|
expand = function(args)
|
|
@@ -287,7 +297,7 @@ cmp.setup({
|
|
|
sorting = {
|
|
|
comparators = {
|
|
|
-- since we only have prefix matches, just sort the results
|
|
|
- cmp.config.compare.sort_text,
|
|
|
+ sort_label,
|
|
|
},
|
|
|
},
|
|
|
})
|