mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(dashboard): allow passing win=0, buf=0 to use for the dashboard instead of creating a new window
This commit is contained in:
parent
02d90ff843
commit
417e07c0d2
1 changed files with 2 additions and 0 deletions
|
@ -203,7 +203,9 @@ function M.open(opts)
|
|||
local self = setmetatable({}, { __index = D })
|
||||
self.opts = Snacks.config.get("dashboard", defaults, opts) --[[@as snacks.dashboard.Opts]]
|
||||
self.buf = self.opts.buf or vim.api.nvim_create_buf(false, true)
|
||||
self.buf = self.buf == 0 and vim.api.nvim_get_current_buf() or self.buf
|
||||
self.win = self.opts.win or Snacks.win({ style = "dashboard", buf = self.buf, enter = true }).win --[[@as number]]
|
||||
self.win = self.win == 0 and vim.api.nvim_get_current_win() or self.win
|
||||
self.augroup = vim.api.nvim_create_augroup("snacks_dashboard", { clear = true })
|
||||
self:init()
|
||||
self:update()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue