mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
Pitfall 3 (REAL BUG): setFlushed() called _render() unconditionally. During tab switch, rendering against a stale buffer found the old session's prompt and locked the column position via the flushed-text column lock. After the new buffer loaded, rerender() kept the stale column. Fix: add render parameter (default true), pass false during tab-switch restore to defer rendering until buffer is loaded. Pitfall 2: Tab completion "undo" required calling clearFlushed() + resetBufferDetection() separately — easy to get wrong. Add undoDetection() convenience method that atomically clears flushed state and re-enables detection. Pitfall 1: Backspace Map sync is app-specific (can't be fixed in lib), but removeChar() return value + getFlushed() make the pattern clean. Updated tab-switch test to demonstrate the correct pattern. Tests: 78 total (+4 new) - setFlushed render=false prevents stale column lock - setFlushed render=false keeps overlay hidden - undoDetection clears flushed + re-enables detection - undoDetection preserves pending text Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>