stevearc / oil.nvim

Neovim file explorer: edit your filesystem like a buffer
MIT License
3.5k stars 99 forks source link

feat: allow bufnr optional parameter for get_current_dir function #440

Closed sleeptightAnsiC closed 1 month ago

sleeptightAnsiC commented 1 month ago

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!

stevearc commented 1 month ago

LGTM thanks!