Skip to content
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: cache opts.cwd so it cannot be changed by another function #70

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

entropitor
Copy link
Contributor

@entropitor entropitor commented Mar 19, 2024

I'm not sure why but for me opts.cwd reverted back to my home directory in the make_display function (while it's correct in the gen_from_fd function). By caching it this way, it works fine 🤷

I'm not sure why but for me opts.cwd reverted back to my home directory
in the make_display function (while it's correct in the gen_from_fd
function). By caching it this way, it works fine 🤷

See also cljoly#70
@cljoly
Copy link
Owner

cljoly commented Mar 20, 2024

@entropitor I’ve slightly edited your PR to add a comment.

Your fix makes sense, thanks for contributing this patch!

@cljoly cljoly merged commit ca8a541 into cljoly:master Mar 20, 2024
1 check passed
@entropitor
Copy link
Contributor Author

Okay, awesome! I think the culprit might be this one by the way

, maybe that should be opts.cwd = opts.cwd or vim.env.HOME?

@entropitor entropitor deleted the fix-cwd branch March 22, 2024 10:04
cljoly added a commit that referenced this pull request Apr 25, 2024
Sometimes, when we cache opts.cwd, it is still nil. While this problem
is investigated [separately][1], it’s worth having this workaround, to
be on the safe side. It’s very disruptive when items can’t be diplayed.

[1]: #70 (comment)

Originally authored by @rish987 in #71. I’ve made cosmetic changes and
added some comments.

Co-authored-by: Rishikesh Vaishnav <[email protected]>
cljoly added a commit that referenced this pull request Apr 25, 2024
Sometimes, when we cache opts.cwd, it is still nil. While this problem
is investigated [separately][1], it’s worth having this workaround, to
be on the safe side. It’s very disruptive when items can’t be diplayed.

[1]: #70 (comment)

Originally authored by @rish987 in #71. I’ve made cosmetic changes and
added some comments.

Co-authored-by: Rishikesh Vaishnav <[email protected]>
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