vim: make sure not to blow up on nil opts
This commit is contained in:
parent
a15e582567
commit
36ceb2c15c
9 changed files with 11 additions and 11 deletions
|
@ -33,7 +33,7 @@ M.keys = {
|
|||
{ 'g<c-x>', dial_cmd('dec_gvisual', 'gv'), expr = true, desc = ' Decrement', mode = 'v' },
|
||||
}
|
||||
|
||||
M.config = function()
|
||||
M.config = function( --[[plugin]] _, --[[opts]] _)
|
||||
local augend = require('dial.augend')
|
||||
require('dial.config').augends:register_group {
|
||||
default = {
|
||||
|
|
|
@ -27,7 +27,7 @@ M.keys = {
|
|||
}
|
||||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
mappings = nil, -- I'm defining my own mappings above.
|
||||
callbacks = {
|
||||
['git.schauenburg.me'] = require('gitlinker.hosts').get_gitea_type_url,
|
||||
|
|
|
@ -20,7 +20,7 @@ M.main = 'ibl'
|
|||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
local icons = require('fschauen.util.icons')
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
enabled = false,
|
||||
indent = {
|
||||
char = icons.ui.LineLeft,
|
||||
|
|
|
@ -10,7 +10,7 @@ M.keys = {
|
|||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
local icons = require('fschauen.util.icons')
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
disable_hint = true,
|
||||
signs = {
|
||||
section = { icons.ui.Folder, icons.ui.EmptyFolderOpen },
|
||||
|
|
|
@ -25,7 +25,7 @@ M.lazy = false
|
|||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
local icons = require('fschauen.util.icons')
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
icons = {
|
||||
ERROR = icons.diagnostics_bold.Error,
|
||||
WARN = icons.diagnostics_bold.Warn,
|
||||
|
|
|
@ -11,7 +11,7 @@ M.keys = {
|
|||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
local icons = require('fschauen.util.icons')
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
disable_netrw = true, -- replace netrw with nvim-tree
|
||||
hijack_cursor = true, -- keep the cursor on begin of the filename
|
||||
sync_root_with_cwd = true, -- watch for `DirChanged` and refresh the tree
|
||||
|
|
|
@ -126,7 +126,7 @@ M.opts = function(--[[plugin]]_, opts)
|
|||
['<c-b>'] = trouble.smart_open_with_trouble,
|
||||
}
|
||||
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
defaults = {
|
||||
mappings = { i = mappings, n = mappings },
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ M.keys = {
|
|||
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
local icons = require('fschauen.util.icons')
|
||||
return vim.tbl_deep_extend('force', opts, {
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
keywords = {
|
||||
TODO = { icon = icons.ui.Checkbox },
|
||||
FIX = { icon = icons.ui.Bug },
|
||||
|
|
|
@ -16,10 +16,10 @@ M.keys = {
|
|||
{ '<leader>sc', toggle_colorcolumn, desc = toggle .. 'virtual colunn' },
|
||||
}
|
||||
|
||||
M.config = function(--[[plugin]]_, --[[opts]]_)
|
||||
require('virt-column').setup {
|
||||
M.opts = function(--[[plugin]]_, opts)
|
||||
return vim.tbl_deep_extend('force', opts or {}, {
|
||||
char = require('fschauen.util.icons').ui.LineMiddle,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Reference in a new issue