From fc3493c5948dcfd86293645a72238aac25ee204d Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Tue, 18 Jan 2022 16:08:48 +0000 Subject: [PATCH] [nvim] Prevent an error in the case of cmp absence --- nvim/plugin/neorg.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvim/plugin/neorg.lua b/nvim/plugin/neorg.lua index 943cfa6..565ea5e 100644 --- a/nvim/plugin/neorg.lua +++ b/nvim/plugin/neorg.lua @@ -1,5 +1,7 @@ local neorg = require('neorg') -local cmp = require('cmp') + +local ok, cmp = pcall(require, 'cmp') +if not ok then return end; local cmp_config = cmp.get_config() table.insert(cmp_config.sources, { name = "neorg" })