diff --git a/doc/recipes.md b/doc/recipes.md index f32fd6ef..0a195988 100644 --- a/doc/recipes.md +++ b/doc/recipes.md @@ -36,7 +36,8 @@ require("oil").setup({ ```lua -- Declare a global function to retrieve the current directory function _G.get_oil_winbar() - local dir = require("oil").get_current_dir() + local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid) + local dir = require("oil").get_current_dir(bufnr) if dir then return vim.fn.fnamemodify(dir, ":~") else