dhruvasagar / vim-prosession

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

Ignore shellslash on nix #42

Closed TSFoster closed 6 years ago

TSFoster commented 6 years ago

The fix for #37 broke the naming of files on non-Windows systems (or at least mine…). I'm not really sure what shellslash does, but this PR checks that the option exists before it uses the value of it.

dhruvasagar commented 6 years ago

&shellslash should successfully give 0 in case it doesn't exist as well. I've merged this anyways though.

TSFoster commented 6 years ago

Ah, ok. &shellslash was giving 0, which is why !&shellslash was giving 1. Should I have just removed the !?

dhruvasagar commented 6 years ago

When set, a forward slash is used when expanding file names. This is useful when a Unix-like shell is used instead of command.com or cmd.exe. Backward slashes can still be typed, but they are changed to forward slashes by Vim.

I assumed when 'shellslash' is set we need to use forward slash, and so if it's not set we use backward slash, so the use of !&shellslash for windows.

dhruvasagar commented 6 years ago

Can you elaborate what exactly broke ? Even without your change it seems to work fine for me though.

dhruvasagar commented 6 years ago

I believe this last change should be good.

TSFoster commented 6 years ago

Because I am on a Mac, !&shellslash was returning 1, which meant it took the Windows branch. What was happening was the sessions were being stored as just dirname.vim, not %path%to%dirname.vim.

I think you your commits have corrected a mistake I made. Sorry, I probably wasn't the right person to fix it, as I don't have a Windows machine to test it on.

dhruvasagar commented 6 years ago

I was testing on a mac as well, I guess the problem was just with my understanding of what shellslash 1/0 is meant to signify. I would hope the current implementation is correct.