fix: missing autocmd data when no branch (#137)
parent
e50e0b65b0
commit
0a9eebf5cc
|
|
@ -37,12 +37,11 @@ function M.make_session_data(session)
|
||||||
|
|
||||||
-- Split the session string into path and branch parts
|
-- Split the session string into path and branch parts
|
||||||
local separator_index = session:find(config.branch_separator)
|
local separator_index = session:find(config.branch_separator)
|
||||||
if not separator_index then
|
local branch = ""
|
||||||
return nil
|
if separator_index then
|
||||||
|
branch = session:sub(separator_index + 2):gsub("%.vim$", ""):gsub("%%", "/")
|
||||||
end
|
end
|
||||||
|
|
||||||
local branch = session:sub(separator_index + 2):gsub("%.vim$", ""):gsub("%%", "/")
|
|
||||||
|
|
||||||
-- Removing the home directory from the path and cleaning leading `/`
|
-- Removing the home directory from the path and cleaning leading `/`
|
||||||
local name = session:gsub(config.save_dir, ""):gsub("%%", "/"):gsub(home, "")
|
local name = session:gsub(config.save_dir, ""):gsub("%%", "/"):gsub(home, "")
|
||||||
-- Remove the .vim extension
|
-- Remove the .vim extension
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue