Skip to content

Commit

Permalink
fix: conflict with vim-endwise fix #430
Browse files Browse the repository at this point in the history
  • Loading branch information
windwp committed Feb 19, 2024
1 parent 2e8a10c commit d4aef9d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lua/nvim-autopairs.lua
Expand Up @@ -624,7 +624,7 @@ M.autopairs_afterquote = function(line, key_char)
append = 'la'
end
return utils.esc(
"<esc><cmd>lua require'nvim-autopairs'.autopairs_closequote_expr()<cr>" .. append
"<esc><cmd>lua require('nvim-autopairs').autopairs_closequote_expr()<cr>" .. append
)
end
end
Expand All @@ -643,19 +643,20 @@ M.check_break_line_char = function()
return M.autopairs_cr()
end

M.map_cr = function()
M.completion_confirm = function()
if vim.fn.pumvisible() ~= 0 then
return M.esc("<cr>")
else
return M.autopairs_cr()
end
M.completion_confirm =function ()
if vim.fn.pumvisible() ~= 0 then
return M.esc("<cr>")
else
return M.autopairs_cr()
end
end

M.map_cr = function()
api.nvim_set_keymap(
'i',
'<CR>',
'',
{ callback = M.completion_confirm, expr = true, noremap = true }
"v:lua.require('nvim-autopairs').completion_confirm()",
{ expr = true, noremap = true }
)
end

Expand Down

0 comments on commit d4aef9d

Please sign in to comment.