lazygit.nvim icon indicating copy to clipboard operation
lazygit.nvim copied to clipboard

[Request] LazyGit window should resize with the viewport

Open chenasraf opened this issue 1 year ago • 0 comments

First of all thanks for a great plugin!

Is your feature request related to a problem? Please describe.

Using tmux panes, or any window/pane resizing feature of your terminal, causes the nvim virtual screen to resize. If I open LazyGit in tmux or a terminal, resizing the viewport doesn't cause LazyGit inside nvim to adapt to the new size.

It works on LazyGit from the terminal, so I believe the nvim window/frame is the one not resizing accordingly.

Additionally, things like Telescope previews can listen to the window resize and adjust accordingly, and the same problem happens in any terminal when resizing, so it is not an inherent tmux+nvim limitation.

Just open LG from nvim and resize the window to see.

image

Screenshots of issue

  1. Before opening, while zoomed out image
  2. After opening, while zoomed out image
  3. After zooming into the nvim pane with LG still open image

This works in the other direction as well:

  1. Before opening, while zoomed in image
  2. After opening, while zoomed in image
  3. After zooming out the nvim pane with LG still open image

Describe the solution you'd like

Ideally, the containing window of LG should resize when the nvim viewport resizes.

Additional context

My config:

return {
  "kdheepak/lazygit.nvim",
  -- optional for floating window border decoration
  dependencies = {
    "nvim-lua/plenary.nvim",
  },
  config = function()
    vim.keymap.set('n', '<leader>gs', '<Cmd>LazyGit<CR>', { desc = 'Lazy[G]it', silent = true })
  end,
}

chenasraf avatar Feb 04 '24 16:02 chenasraf