Skip to content

#837 find file symlinks fixes #1093

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

Merged
merged 6 commits into from
Mar 26, 2022
Merged

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Mar 20, 2022

#837 and #1092 exposed some remaining issues with symlink resolution. This covers the find-file cases.

Branched off #1092. Please review / merge that first.

local stat, _ = uv.fs_stat(node.absolute_path)
if not stat then
break
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra safety check cannot hurt.

return i
end
local abs_match = vim.startswith(fname_real, node.absolute_path .. utils.path_separator)
local real_match = vim.startswith(fname_real, real_path .. utils.path_separator)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep a "real path" on the node, however that seems too complicated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a link_to attributes for symlinks on node, maybe this is what you would like to use here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a link_to attributes for symlinks on node, maybe this is what you would like to use here ?

Goot thinking. I'll rework on the weekend.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now simpler, thank you.

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@kyazdani42 kyazdani42 merged commit 015234e into master Mar 26, 2022
@kyazdani42 kyazdani42 deleted the #837-find-file-symlinks-fixes branch April 30, 2022 12:33
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants