Describe the bug
popup_clear() does not close terminal popup windows.
To Reproduce
Run this shell command:
vim -Nu NONE +"call popup_create(term_start(&shell, #{hidden: v:true}), #{highlight: 'Normal', border: [], line: 6, col: 5, minheight: 12, minwidth: 68})"
Then this Ex command to close the popup terminal:
:call popup_clear()
The window stays open, and E994: Not allowed in a popup window is raised.
Expected behavior
The window is closed, and no error is raised.
If it's not possible for popup_clear() to close a popup terminal, then it's documented at :h popup-terminal, inside the list of items after the sentence Many rules are then different:.
Environment
Additional context
An alternative is to first execute sil! popup_close(), but there may be several popup terminals. So, I guess you need a :while loop and a :try conditional inside, to close all of them before invoking popup_clear():
while 1
try
call popup_close(win_getid())
catch /^Vim\%((\a\+)\)\=:E99[34]:/
break
endtry
endwhile
call popup_clear()
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Fixed by 03a9f84.
Closed #5745.