Skip to content

Commit

Permalink
cleaned the code up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-programs authored and Sam-programs committed Oct 14, 2023
1 parent f0af1b6 commit 7e98d2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/nvim-autopairs/completion/cmp.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local autopairs = require('nvim-autopairs')
local handlers = require('nvim-autopairs.completion.handlers')
local cmp = require('cmp')
local utils = require('nvim-autopairs.utils')

local Kind = cmp.lsp.CompletionItemKind

Expand Down Expand Up @@ -105,14 +106,13 @@ M.cpp_pairs = function(evt)
pairs = ' '
end
pairs = pairs .. '<>'
pairs = vim.api.nvim_replace_termcodes(pairs .. "<left>", true, false, true)
pairs = pairs .. utils.esc('<left>')
vim.api.nvim_feedkeys(pairs, "n", false)
end
end

local cmp_config = require('cmp.config')
local cmp_comparetors = cmp_config.get().sorting.comparators
local kind = cmp.lsp.CompletionItemKind

local unpack = unpack or table.unpack
local function cpp_sort_cmp(entry1, entry2)
Expand All @@ -121,10 +121,10 @@ local function cpp_sort_cmp(entry1, entry2)
if vim.o.filetype ~= "cpp" then
return nil
end
if kind1 == kind.Constructor and kind2 == kind.Class then
if kind1 == Kind.Constructor and kind2 == Kind.Class then
return false
end
if kind1 == kind.Class and kind2 == kind.Constructor then
if kind1 == Kind.Class and kind2 == Kind.Constructor then
return true
end
return nil
Expand Down

0 comments on commit 7e98d2b

Please sign in to comment.