-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ~ normalization in Path:normalize() #279
Conversation
662f6a5
to
68946c8
Compare
I'm happy to merge this once the changes pointed out by |
68946c8
to
dc3f1b2
Compare
Thanks, I (hopefully) fixed stylua problems. |
Looks good to me 🙂 |
Thank you for your help. ;) |
Note that PR has introduced the arguably incorrect behaviour that you can now end up with double slashes in your normalized path. eg: if I think a more correct approach will be to check if I'll submit a new PR |
It is expected in sense there is even test for that. Personally I think this is not a problem at all, it's a valid, doesn't cause any problems, and makes code simpler. |
assert.are.same("~//./test_file", p:normalize()) This is not normalized. This shouldnt have been merged. Ref: nvim-telescope/telescope.nvim#1662 nvim-telescope/telescope.nvim#1683 |
@Conni2461 I have a change in a local branch which just checks for trailing slash in
It will result in the following behaviour:
So at least the double slash is removed, but arguably this isn't normalized either, as the In any event, I can submit the above change as a PR if you wish? |
Well, so I was wrong about it not being a problem… |
@Conni2461 I've created a PR (#308) with the above mentioned change - if you feel it's not the correct approach more than happy to alter it... |
This fixes nvim-telescope/telescope.nvim#1521. The problem is that if $HOME directory contains trailing slash, then Path:normalize() will convert
/home/user/my_file
into~my_file
.