vim: make sure not to blow up on nil opts

This commit is contained in:
Fernando Schauenburg 2024-02-19 02:04:09 +01:00
parent a15e582567
commit 36ceb2c15c
9 changed files with 11 additions and 11 deletions

View file

@ -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 = {

View file

@ -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,

View file

@ -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,

View file

@ -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 },

View file

@ -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,

View file

@ -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

View file

@ -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 },

View file

@ -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 },

View file

@ -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