fix again nil issues

This commit is contained in:
ThePrimeagen 2021-02-22 11:14:46 -07:00
parent 7106e067cb
commit 322d07be58
3 changed files with 22 additions and 10 deletions

View File

@ -132,8 +132,8 @@ M.setup = function(config)
-- an object for cwd
ensure_correct_config(complete_config)
terminals.setup(complete_config)
mark.setup(complete_config)
terminals.setup(complete_config.projects[cwd].term)
mark.setup(complete_config.projects[cwd].mark)
harpoon_config = complete_config
end

View File

@ -14,10 +14,16 @@ function get_id_or_current_buffer(id)
end
M.setup = function(config)
if not config.projects[cwd] then
mark_config = {marks = {}}
else
mark_config = config.projects[cwd].mark
mark_config = config
if mark_config.marks == nil then
-- resetting the mark config if there is an issue loading the config
-- this can hide errors.
--
-- TODO: create a logging mechanism to get these values
mark_config = {
marks = {}
}
end
end

View File

@ -64,11 +64,17 @@ end
}
}
--]]
M.setup = function(config)
if not config.projects[cwd] then
terminal_config = {}
else
terminal_config = config.projects[cwd].term
terminal_config = config
if terminal_config.cmds == nil then
-- Resets terminal config if there is some missing values.
--
-- TODO: create a logging mechanism to get these values
terminal_config = {
cmds = {}
}
end
end