|
@@ -252,6 +252,16 @@ require('treesj').setup({
|
|
-- completion
|
|
-- completion
|
|
local cmp = require('cmp')
|
|
local cmp = require('cmp')
|
|
local cmp_types = require('cmp.types')
|
|
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({
|
|
cmp.setup({
|
|
snippet = {
|
|
snippet = {
|
|
expand = function(args)
|
|
expand = function(args)
|
|
@@ -287,7 +297,7 @@ cmp.setup({
|
|
sorting = {
|
|
sorting = {
|
|
comparators = {
|
|
comparators = {
|
|
-- since we only have prefix matches, just sort the results
|
|
-- since we only have prefix matches, just sort the results
|
|
- cmp.config.compare.sort_text,
|
|
|
|
|
|
+ sort_label,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
})
|