postwin: pcall nvim_win_close to ignore errors#260
postwin: pcall nvim_win_close to ignore errors#260elgiano wants to merge 1 commit intodavidgranstrom:mainfrom
Conversation
|
Thanks for finding this. I'm wondering though if the actual bug is that |
|
I agree, I'll stay a little longer without the fix and see if I find a way to reproduce.
We are already checking for is_valid.. so I guess we are in a situation where window is valid but can't be closed...
The only hint that comes to my mind is "textlock".
Let's see if something comes up!
Thanks
…-------- Original Message --------
On 10/3/25 10:20, David Granström wrote:
davidgranstrom left a comment [(davidgranstrom/scnvim#260)](#260 (comment))
Thanks for finding this. I'm wondering though if the actual bug is that postwin.is_open() answers true in this case when it shouldn't. Would be nice to see if that could be improved first - but otherwise this should do it.
—
Reply to this email directly, [view it on GitHub](#260 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AACNMWW4NPCQ7VMCY4UC3LL3VYWU7AVCNFSM6AAAAACIFBIR4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRUG4ZTMOBYGU).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Using your code snippet an easy way to reproduce would be to:
|
|
this worked perfectly, thanks! |
|
Ideally |
I've been in situation when the postwin is already closed and I get an error when trying to close it again, saying that it can't be closed. In this PR I wrap
nvim_win_closeinpcall, so that errors are ignored.If anyone is curious about my actual use case, I have a function to move postwin from side to bottom:
And this errors if the postwin is already closed.