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

feat: allow bufnr optional parameter for get_current_dir function #440

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

sleeptightAnsiC
Copy link
Contributor

Hi @stevearc, (big fan of your plugin here)

I had a small problem while integrating Oil with a tabline/statusline plugin (lualine.nvim). The problem was that sometimes I had multiple buffers open and Oil buffer wasn't always the currently hovered one. In such cases get_current_dir is not working as one would expect as it has a hardcoded reference to buffer 0. My patch simply adds an optional parameter bufnr to said function to make it usable in such cases. This should not break the API in any way and I updated the documentation accordingly. If I screwed something up the PR is open for your edits :)

Cheers!

This allows for using get_current_dir in cases where currently hovered
buffer is not the desired Oil buffer (e.g. displaying directories for
multiple different Oil buffers)
@github-actions github-actions bot requested a review from stevearc July 6, 2024 00:10
@stevearc
Copy link
Owner

stevearc commented Jul 6, 2024

LGTM thanks!

@stevearc stevearc merged commit cc23325 into stevearc:master Jul 6, 2024
9 checks passed
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