Files
lazygit.nvim/lua
Anthony b4229a094b fix: plenary usage crash (#156)
Fixes bug created in the [commit
ac4a400](ac4a400b25)
**Prevent crash when using plenary.window.float for floating window**

This MR fixes a bug caused by inconsistent return values from
get_window_pos() when vim.g.lazygit_floating_window_use_plenary is
enabled.

**Problem**
When plenary.window.float is used, get_window_pos() returned (win_id,
bufnr) instead of the expected (width, height, row, col). This led to a
runtime error:
E5108: Error executing lua ...window.lua:33: attempt to perform
arithmetic on local 'row' (a nil value)

**Solution**
Ensure that get_window_pos() always returns consistent values and
explicitly handle the Plenary case in open_floating_window().

This prevents arithmetic operations on nil values and restores
compatibility with the Plenary-based layout logic.

**Tested**
- Works correctly with and without
vim.g.lazygit_floating_window_use_plenary set.
- No runtime errors on window resize or open.
- Borders and buffer correctly positioned in both modes.

Co-authored-by: abezlyudniy <abezlyudniy@ozon.ru>
2025-07-21 07:27:19 -04:00
..
2025-07-21 07:27:19 -04:00
2022-09-06 15:35:28 +02:00