Skip to content

Commit

Permalink
doc: update winbar recipe to be window-specific (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 5, 2025
1 parent 254bc66 commit c12fad2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c12fad2

Please sign in to comment.