This fixes the bug mentioned here where Coqtail prints an error and then stops updating the Goal panel. The problem was switching to another buffer would close the Goal window, but not reset b:coqtail_panel_richpp. Then when s:replace is next called it calls matchdelete on the old match IDs from the previous window, which no longer exist. This would raise E803, and if this happened during an autocmd (like handling sync on InsertEnter) it caused s:evalexpr to fail, which in turn made s:call fail and print an error about a missing endif.
Also use window IDs consistently instead of a mix of IDs and window numbers (:h window-ID).
This fixes the bug mentioned here where Coqtail prints an error and then stops updating the Goal panel. The problem was switching to another buffer would close the Goal window, but not reset
b:coqtail_panel_richpp
. Then whens:replace
is next called it callsmatchdelete
on the old match IDs from the previous window, which no longer exist. This would raiseE803
, and if this happened during anautocmd
(like handlingsync
onInsertEnter
) it causeds:evalexpr
to fail, which in turn mades:call
fail and print an error about a missingendif
.Also use window IDs consistently instead of a mix of IDs and window numbers (
:h window-ID
).