While it may not be the only culprit, coc.nvim is a bit notorious for leaving popups hanging around the screen long after they should be cleared. Sometimes, as in the gif below, dangling popups will disappear when the next is instantiated, but in rarer cases, they will hang around for the remainder of the nvim session, which behavior can sometimes necessitate closing and restarting nvim entirely with obvious attendant loss in productivity and organization.
small side note for anyone paying close attention: the popup incorrectly stating that
my_first_initial is defined as a space is a problem with the rust language server and not relevant to this discussion
vim provides popup_clear as an "[e]mergency solution to a misbehaving plugin", but nvim for some reason does not provide the same functionality. Can someone please point me to an nvim solution for clearing misbehaving popups from the screen?
EDIT: I stumbled across
wincmd in another context and realized that
winnr('$').'wincmd c', i.e. close the last window, is a fairly reliable way to do this, provided of course that a popup is open, and also that it is the last window, which it consistently seems to be.
Can anyone expand on this? Is the assumption that an open popup is the last window valid? Is there a more disciplined way to find the correct window to close (and do nothing if there is no popup open)?