rmagatti / session-lens

A session-switcher extension for rmagatti/auto-session using Telescope.nvim
MIT License
226 stars 13 forks source link

Weird path display on windows #22

Open bradleybauer opened 2 years ago

bradleybauer commented 2 years ago

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 commented 2 years ago

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.

rmagatti commented 2 years ago

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!