fix(mappings): use pcall over require since cosmic.config.plugins might not be present
This commit is contained in:
parent
80580b7f7b
commit
99adce7770
1 changed files with 8 additions and 6 deletions
|
@ -1,13 +1,15 @@
|
||||||
local map = require('cosmic.utils').map
|
local map = require('cosmic.utils').map
|
||||||
local user_plugins = require('cosmic.config.plugins')
|
local ok, user_plugins = pcall(require, 'cosmic.config.plugins')
|
||||||
|
|
||||||
-- Mappings for plugins that need to be lazy loaded
|
-- Mappings for plugins that need to be lazy loaded
|
||||||
if not vim.tbl_contains(user_plugins.disable, 'nvim-tree') then
|
if ok then
|
||||||
require('cosmic.plugins.nvim-tree.mappings')
|
if not vim.tbl_contains(user_plugins.disable, 'nvim-tree') then
|
||||||
end
|
require('cosmic.plugins.nvim-tree.mappings')
|
||||||
|
end
|
||||||
|
|
||||||
if not vim.tbl_contains(user_plugins.disable, 'auto-session') then
|
if not vim.tbl_contains(user_plugins.disable, 'auto-session') then
|
||||||
require('cosmic.plugins.auto-session.mappings')
|
require('cosmic.plugins.auto-session.mappings')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Quickfix mappings
|
-- Quickfix mappings
|
||||||
|
|
Loading…
Add table
Reference in a new issue