From c12fad2d225d8f81fadd48521d253607fe25465c Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 4 Jan 2025 21:50:16 -0800 Subject: [PATCH] doc: update winbar recipe to be window-specific (#546) --- doc/recipes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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