feat(git): give every new git window a fresh jumplist

This commit is contained in:
2026-04-29 15:46:54 +02:00
parent 81bc011b09
commit 2335d5e0dd
5 changed files with 40 additions and 10 deletions
+5 -3
View File
@@ -82,8 +82,8 @@ end
---Place a buffer in the current window or a new split per `split`.
---`false` replaces the current buffer, dropping a `'` mark first so
---`''` jumps back. A direction string opens a leftabove split. Nil
---falls back to a `splitbelow`-aware horizontal split.
---`''` jumps back. A direction string opens a split on that side. Nil
---falls back to `'splitbelow'` for the direction.
---@param buf integer
---@param split (false|"above"|"below"|"left"|"right")?
---@return integer win
@@ -93,9 +93,11 @@ function M.place_buf(buf, split)
vim.api.nvim_set_current_buf(buf)
return vim.api.nvim_get_current_win()
end
return vim.api.nvim_open_win(buf, true, {
local win = vim.api.nvim_open_win(buf, true, {
split = split or (vim.o.splitbelow and "below" or "above"),
})
vim.cmd("clearjumps")
return win
end
---@class ow.Git.NewScratchOpts : ow.Git.ScratchOpts