[vim/vim] "popup_clear()" can't not close terminal popup windows (#5745)

103 views
Skip to first unread message

lacygoill

unread,
Mar 7, 2020, 4:42:23 AM3/7/20
to vim/vim, Subscribed

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

  • Vim version: 8.2 Included patches: 1-360
  • OS: Ubuntu 16.04.6 LTS
  • Terminal: XTerm(322)

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.

lacygoill

unread,
May 13, 2020, 8:28:32 AM5/13/20
to vim/vim, Subscribed

Fixed by 03a9f84.

lacygoill

unread,
May 13, 2020, 8:28:33 AM5/13/20
to vim/vim, Subscribed

Closed #5745.

Reply all
Reply to author
Forward
0 new messages