Skip to content

utils.get_session_file have error with path have _ #76

@Parsifa1

Description

@Parsifa1

M.get_session_file = function(name, dirname)
local files = require("resession.files")
local filename = string.format("%s.json", name:gsub(files.sep, "_"):gsub(":", "_"))
return files.join(M.get_session_dir(dirname), filename)
end

if there is an path named /foo/bar/foo_bar/ ,then it will transform into _foo_bor_foo_bar_.

i'm trying to write a wrapper of resession and i encounter problems here:

i need to re-transform the _foo_bar_foo_bar_ to /foo/bar/foo_bar/ and this will cause error.

can we have an api in config to set the separator for user them self?
i'd like to using __ for / and ++ for :

if it's ok, i can make an pr for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions