In src/cursed/view/view_render.lua the render method explicitly calls self:_run_overlays(sm, editor) before calling sm:finish_frame(term). However SpanManager:finish_frame() (in src/cursed/span_manager.lua) also calls view:_run_overlays(self, editor) as its first step. This means every overlay function (completion menu, which-key, diagnostic hover, LSP hover, mdview demo, etc.) is invoked twice per frame. The first invocation during render adds its layer/anchor spans to the staging area; the second invocation during finish_frame appends the same spans again. All staged spans are then painted, so no visible double-render occurs, but compute-intensive overlays (which-key layout, completion menu candidate positioning) are executed twice per frame, wasting CPU and causing duplicate log lines (e.g. "render_painted" emitted twice).
Fix: Remove the explicit self:_run_overlays(sm, editor) call from View:render() in view_render.lua and rely solely on the call inside SpanManager:finish_frame(). The overlay functions will then be invoked exactly once per frame, at the correct point (after content painting, before staging paint).
Commit range: 50d68c50..50d68c50
Related commits: 50d68c50