kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.31k stars 52 forks source link

fix: plenary.percentage_range_window returns 'win_id' and 'bufnr' #102

Closed gmerzu closed 11 months ago

gmerzu commented 11 months ago

When using vim.g.lazygit_floating_window_use_plenary = 1, Nothing is returned by plenary.percentage_range_window from open_floating_window, and win/buffer variables are nil.

As result LazyGit buffer is not closed in lazygit.on_exit callback due to an exception from vim.api.nvim_win_close(win, true): ua/lazygit.lua:28: Expected Lua number

In addition, after LazyGit exit, the window is still opened with the text: [Process exited 0]

This PR fixes the issue by returning ret.win_id, ret.bufnr from open_floating_window when plenary is used.

kdheepak commented 11 months ago

Thanks for addressing that and making a PR!