doc: update winbar recipe to be window-specific (#546)
This commit is contained in:
parent
254bc6635c
commit
c12fad2d22
1 changed files with 2 additions and 1 deletions
|
|
@ -36,7 +36,8 @@ require("oil").setup({
|
||||||
```lua
|
```lua
|
||||||
-- Declare a global function to retrieve the current directory
|
-- Declare a global function to retrieve the current directory
|
||||||
function _G.get_oil_winbar()
|
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
|
if dir then
|
||||||
return vim.fn.fnamemodify(dir, ":~")
|
return vim.fn.fnamemodify(dir, ":~")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue