Scenario: grab a pane, then search the surface for some text that takes the pane out of the viewport.
Searching clears all line_cache arrays all across the surface. plan_draw only brings back line_cache for panes that intersect with the viewport, but it doesn't take the grab pane. Boom.
This was hard to understand because I forgot for the umpteenth time where I'm undoing clean_up_panes. Hopefully this organization will make it easier to remember the complexities and why I can't just call Text.redraw_all() in plan_draw().
AEIAYEN3YCCNVDKAQSFBJW75DAUQOJKNIP7JDO34CJ67V34PDK3QC
-- The basic text editor buffer (editor State) in edit.lua and text.lua
-- assumes there's always an element in line_cache for every line. However,
-- this can be a lot of overhead when we have hundreds of buffers. So pensieve
-- needs to violate this assumption while hiding it from buffer helpers.