Compare commits

..

No commits in common. "688a457a3db07d8972ae7f8ceab1722b7e145f64" and "335fbea0c0a7813ea5612ab4070a32f4b860fba4" have entirely different histories.

2 changed files with 10 additions and 13 deletions

View file

@ -4,6 +4,7 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.lua) toLuaObject;
@ -13,7 +14,7 @@ in {
vim.startPlugins = ["nvim-autopairs"]; vim.startPlugins = ["nvim-autopairs"];
vim.luaConfigRC.autopairs = entryAnywhere '' vim.luaConfigRC.autopairs = entryAnywhere ''
require("nvim-autopairs").setup({ map_cr = ${toLuaObject (!config.vim.autocomplete.enable)} }) require("nvim-autopairs").setup{}
''; '';
}; };
} }

View file

@ -61,19 +61,15 @@ in {
(mkSetLuaBinding mappings.complete '' (mkSetLuaBinding mappings.complete ''
require('cmp').complete require('cmp').complete
'') '')
(let (mkSetLuaBinding mappings.confirm ''
defaultKeys = function()
if config.vim.autopairs.enable if not require('cmp').confirm({ select = true }) then
then "require('nvim-autopairs').autopairs_cr()" local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
in vim.fn.feedkeys(termcode, 'n')
mkSetLuaBinding mappings.confirm ''
function()
if not require('cmp').confirm({ select = true }) then
vim.fn.feedkeys(${defaultKeys}, 'n')
end
end end
'') end
'')
(mkSetLuaBinding mappings.next '' (mkSetLuaBinding mappings.next ''
function() function()
local has_words_before = function() local has_words_before = function()