whonore / Coqtail

Interactive Coq Proofs in Vim
MIT License
274 stars 34 forks source link

Clear `b:coqtail_panel_richpp` when hiding the Goal or Info panels #235

Closed whonore closed 3 years ago

whonore commented 3 years ago

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).