Skip to content

Commit

Permalink
Ensure buffer is focused before resizing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Aug 11, 2023
1 parent 0891299 commit 9fc7987
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/neogit/lib/popup/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ function M:show()
filetype = "NeogitPopup",
kind = config.values.popup.kind,
mappings = mappings,
after = function()
after = function(buf, _)
vim.cmd([[setlocal nocursorline]])

if self.state.env.highlight then
Expand All @@ -585,7 +585,9 @@ function M:show()

if config.values.popup.kind == "split" or config.values.popup.kind == "split_above" then
vim.schedule(function()
vim.cmd.resize(vim.fn.line("$") + 2)
if buf:is_focused() then
vim.cmd.resize(vim.fn.line("$") + 1)
end
end)
end
end,
Expand Down

0 comments on commit 9fc7987

Please sign in to comment.