[MINOR] Added underline comparator to cmp
This commit is contained in:
parent
00ae43a23d
commit
c32f3e7f1a
1 changed files with 13 additions and 0 deletions
|
@ -126,6 +126,19 @@ cmp.setup {
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact,
|
||||||
cmp.config.compare.offset,
|
cmp.config.compare.offset,
|
||||||
cmp.config.compare.recently_used,
|
cmp.config.compare.recently_used,
|
||||||
|
|
||||||
|
--Make entries that start with underline appear after
|
||||||
|
function(entry1, entry2)
|
||||||
|
local _, entry1_under = entry1.completion_item.label:find "^_+"
|
||||||
|
local _, entry2_under = entry2.completion_item.label:find "^_+"
|
||||||
|
entry1_under = entry1_under or 0
|
||||||
|
entry2_under = entry2_under or 0
|
||||||
|
if entry1_under > entry2_under then
|
||||||
|
return false
|
||||||
|
elseif entry1_under < entry2_under then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources(
|
sources = cmp.config.sources(
|
||||||
|
|
Loading…
Add table
Reference in a new issue