Fixes bug created in the [commitac4a400](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>
4.5 KiB
4.5 KiB