kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.47k stars 53 forks source link

`let g:lazygit_floating_window_use_plenary = 1` results in error when quitting #88

Open kohane27 opened 1 year ago

kohane27 commented 1 year ago

Hello there. Hope you're doing well. Thank you for creating this amazing lazygit wrapper!

Description

I have plenary.nvim installed.

If I set let g:lazygit_floating_window_use_plenary = 1, whenever I quit the lazygit window, the following error is resulted:

...nvim/site/pack/packer/start/lazygit.nvim/lua/lazygit.lua:28: Expected Lua number
stack traceback:
^I[C]: in function 'nvim_win_close'
^I...nvim/site/pack/packer/start/lazygit.nvim/lua/lazygit.lua:28: in function <...nvim/site/pack/packer/start/lazygit.nvim/lua/lazygit.lua:17>
Press ENTER or type command to continue

2022-12-27-12-56-40

Setting it to 0 (i.e., let g:lazygit_floating_window_use_plenary = 0) and the error is gone.

Expected behavior

Quitting lazygit window cleanly and without errors.

System info

Neovim version:

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui

OS: EndeavourOS Linux x86_64 Kernel: Linux 6.1.1-arch1-1

Thank you!

juniorsaldanha commented 5 months ago

Anything on this? I'm getting this error right now without even configuring plenary, i'm just using the default setup options.

commit pulled by lazy: 0ada6c6 https://github.com/kdheepak/lazygit.nvim/assets/30378044/b70c4860-efcd-4efa-bea0-fee1f1cc7ac7

kdheepak commented 5 months ago

Sorry, this fell off my radar. I’ll look into this today!

aidigital commented 4 months ago

Anything on this? I'm getting this error right now without even configuring plenary, i'm just using the default setup options.

commit pulled by lazy: 0ada6c6 https://github.com/kdheepak/lazygit.nvim/assets/30378044/b70c4860-efcd-4efa-bea0-fee1f1cc7ac7

It may have to do with the terminal that you're using. Specifically, when you hit q to exit, your terminal may kill the lazygit buffer, and when lazygit.nvim tries to close it, it's no longer there. I have run into this issue with nvterm if having their behavior.close_on_exit = true. If I set that to false or if I use another term e.g. toggleterm, lazygit exits without this error.