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 -- an object for cwd
ensure_correct_config(complete_config) ensure_correct_config(complete_config)
terminals.setup(complete_config) terminals.setup(complete_config.projects[cwd].term)
mark.setup(complete_config) mark.setup(complete_config.projects[cwd].mark)
harpoon_config = complete_config harpoon_config = complete_config
end end

View File

@ -14,10 +14,16 @@ function get_id_or_current_buffer(id)
end end
M.setup = function(config) M.setup = function(config)
if not config.projects[cwd] then mark_config = config
mark_config = {marks = {}} if mark_config.marks == nil then
else
mark_config = config.projects[cwd].mark -- 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
end end

View File

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