dhruvasagar / vim-prosession

Handle vim sessions like a pro
254 stars 22 forks source link

Unable to create sessions for git branches containing "/" #105

Closed KohlJary closed 7 months ago

KohlJary commented 1 year ago

My work's git branch naming convention contains slashes in branch names, which causes session files tied to the branch to be unable to be created as the branch name is not escaped like the directory path is.

dhruvasagar commented 1 year ago

@KohlJary Thanks for bringing this to my attention, I shall look into this. Slashes in git branch names is a common practice and should definitely be supported.

KohlJary commented 1 year ago

To be precise, the issue was exhibited on Windows 10 Enterprise, I suspect due to backslashes being escaped but not forward slashes, found a similar issue in another plugin where that was the root cause. I can take a look myself sometime soon here.

KohlJary commented 1 year ago

https://github.com/dhruvasagar/vim-prosession/blob/249b635d7483c8e1f8fcdcc50e1457b65a2bbf29/plugin/prosession.vim#L81

Pretty sure the call to prosession#GetCurrBranch here needs to be wrapped in a fnamemodify() call, let me get this forked and try it and see how it works.

KohlJary commented 1 year ago

Nevermind I was way off base, issue is related to Windows handling specifically and how the git branch command is called/the default git branch command. Gonna take some time after work today to tighten it up then I'll have a PR for you.

dhruvasagar commented 1 year ago

@KohlJary Thanks a lot!

dhruvasagar commented 7 months ago

@KohlJary closing this issue for now. Let me know if you need any help for the PR to fix this ?

KohlJary commented 5 months ago

I've been using the version with this applied in my fork on my Windows box for... too long now without any problems, my apologies for not making the PR sooner.