session-lens icon indicating copy to clipboard operation
session-lens copied to clipboard

Weird path display on windows

Open bradleybauer opened this issue 2 years ago • 2 comments

image I store session in C:\Users\Bradley\nvimsessions\ with auto-session. But when I view them in the session picker the paths have % characters in them and a C++ where there should be C:. Does this plugin work on windows?

bradleybauer avatar Mar 08 '22 22:03 bradleybauer

Setting display in this function https://github.com/rmagatti/session-lens/blob/b88c264ab4010aa5ff25d3aa366f76b6338a4783/lua/telescope/_extensions/session-lens/session-lens-library.lua#L76 to this value

display = function(_)
  if opts.path_display and vim.tbl_contains(opts.path_display, "shorten") then
    line = path:new(line):shorten()
  end
  return line
end,

fixes the problem for me. I would submit a pull request but I really have no idea what I am doing when it comes to nvim and lua.

bradleybauer avatar Mar 09 '22 16:03 bradleybauer

Hey sorry about the wait! So doing this means it doesn't really work well for MacOS and I'm assuming Linux too. What those lines are doing is basically unescaping the path. Escaping would have to just be different for Windows. I'm not particularly interested in supporting Windows myself but would welcome PRs fixing this for Windows as long as it doesn't break MacOS and Linux.

If you'd like to submit something let me know and we can also just work together. Cheers!

rmagatti avatar Jun 29 '22 05:06 rmagatti