diff options
| author | kylo252 <[email protected]> | 2021-11-28 16:52:56 +0100 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-28 16:52:56 +0100 | 
| commit | 5c0ccff78f199c46aea47fa756e7c748477e5c65 (patch) | |
| tree | d2183ddc54271ad5f43113e9cca8100b6a9f4dd7 | |
| parent | 24be0ef1ef36b8cc725655e920104e9676b72f25 (diff) | |
fix: correct order for cmp's setup (#1999)
| -rw-r--r-- | lua/lvim/bootstrap.lua | 3 | ||||
| -rw-r--r-- | lua/lvim/core/cmp.lua | 3 | ||||
| -rw-r--r-- | lua/lvim/plugins.lua | 32 | 
3 files changed, 22 insertions, 16 deletions
diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua index 051f7698..7545b3be 100644 --- a/lua/lvim/bootstrap.lua +++ b/lua/lvim/bootstrap.lua @@ -2,6 +2,7 @@ local M = {}  local uv = vim.loop  local path_sep = uv.os_uname().version:match "Windows" and "\\" or "/" +local in_headless = #vim.api.nvim_list_uis() == 0  ---Join path segments that were passed as input  ---@return string @@ -77,7 +78,7 @@ function M:init(base_dir)    vim.fn.mkdir(get_cache_dir(), "p")    -- FIXME: currently unreliable in unit-tests -  if not os.getenv "LVIM_TEST_ENV" then +  if not in_headless then      _G.PLENARY_DEBUG = false      require("lvim.impatient").setup {        path = join_paths(self.cache_dir, "lvim_cache"), diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua index 89159ebb..afad3ead 100644 --- a/lua/lvim/core/cmp.lua +++ b/lua/lvim/core/cmp.lua @@ -301,8 +301,7 @@ M.config = function()    }  end -M.setup = function() -  require("luasnip/loaders/from_vscode").lazy_load() +function M.setup()    require("cmp").setup(lvim.builtin.cmp)  end diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 6a131390..6d59926e 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -15,7 +15,7 @@ local commit = {    nlsp_settings = "1e75ac7733f6492b501a7594870cf75c4ee23e81",    null_ls = "b07ce47f02c7b12ad65bfb4da215c6380228a959",    nvim_autopairs = "fba2503bd8cd0d8861054523aae39c4ac0680c07", -  nvim_cmp = "ca6386854982199a532150cf3bd711395475ebd2", +  nvim_cmp = "092fb66b6ddb4b12b9b542d105d7af40e4fbd9f2",    nvim_dap = "4e8bb7ca12dc8ca6f7a500cbb4ecea185665c7f1",    nvim_lsp_installer = "52183c68baf9019c8241b1abf33ba0b6594ab3c8",    nvim_lspconfig = "b53f89c16bcc8052aa56d3a903fcad3aaa774041", @@ -78,44 +78,50 @@ return {      "hrsh7th/nvim-cmp",      commit = commit.nvim_cmp,      config = function() -      require("lvim.core.cmp").setup() -    end, -    run = function() -      -- cmp's config requires cmp to be installed to run the first time -      if not lvim.builtin.cmp then -        require("lvim.core.cmp").config() +      if lvim.builtin.cmp then +        require("lvim.core.cmp").setup()        end      end, +    requires = { +      "L3MON4D3/LuaSnip", +      "rafamadriz/friendly-snippets", +    }, +    module = "cmp",    },    {      "rafamadriz/friendly-snippets",      commit = commit.friendly_snippets, -    -- event = "InsertCharPre", -    -- disable = not lvim.builtin.compe.active,    },    {      "L3MON4D3/LuaSnip", +    config = function() +      require("luasnip/loaders/from_vscode").lazy_load() +    end,      commit = commit.luasnip,    },    { +    "hrsh7th/cmp-nvim-lsp", +    commit = commit.cmp_nvim_lsp, +  }, +  {      "saadparwaiz1/cmp_luasnip",      commit = commit.cmp_luasnip, +    after = "cmp",    },    {      "hrsh7th/cmp-buffer",      commit = commit.cmp_buffer, -  }, -  { -    "hrsh7th/cmp-nvim-lsp", -    commit = commit.cmp_nvim_lsp, +    after = "cmp",    },    {      "hrsh7th/cmp-path",      commit = commit.cmp_path, +    after = "cmp",    },    {      "hrsh7th/cmp-nvim-lua",      commit = commit.cmp_nvim_lua, +    after = "cmp",    },    -- Autopairs  | 
