diff --git a/lua/persisted/init.lua b/lua/persisted/init.lua index 95c4f1a..e853d58 100644 --- a/lua/persisted/init.lua +++ b/lua/persisted/init.lua @@ -104,7 +104,6 @@ local function get_last() return sessions[1] end - ---Get the current Git branch name, untouched ---@param dir? string Directory to be used for the session ---@return string|nil @@ -219,11 +218,7 @@ function M.load(opt, dir) end end - if - config.options.autosave - and (allow_dir(dir) and not ignore_dir(dir)) - and not ignore_branch(branch) - then + if config.options.autosave and (allow_dir(dir) and not ignore_dir(dir)) and not ignore_branch(branch) then M.start() end end @@ -286,7 +281,11 @@ function M.save(opt, dir) end -- Do not save the session if the callback returns false...unless it's forced - if not opt.force and type(config.options.should_autosave) == "function" and not config.options.should_autosave() then + if + not opt.force + and type(config.options.should_autosave) == "function" + and not config.options.should_autosave() + then return end end diff --git a/lua/persisted/utils.lua b/lua/persisted/utils.lua index cd86d8b..0cab082 100644 --- a/lua/persisted/utils.lua +++ b/lua/persisted/utils.lua @@ -82,7 +82,9 @@ end ---@return boolean function M.dirs_match(dir, dirs_table) dir = vim.fn.expand(dir) - return M.table_match(dir, dirs_table, function(pattern) return escape_pattern(vim.fn.expand(pattern)) end) + return M.table_match(dir, dirs_table, function(pattern) + return escape_pattern(vim.fn.expand(pattern)) + end) end ---Check if a string matches and entry in a given table