From 9102dd1938cd9e305a98ad625ac9547cacf2ce5b Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Tue, 3 Mar 2026 16:58:56 -0600 Subject: [PATCH] Fix cursor ghost at end of lines when cursor changes rows WriteDeferredBuf now dirties the old cursor row before the render loop so the reverse-video cursor block is erased. FlipToScreen's ghost cleanup was ineffective because FLastCursorRow was already updated by WriteDeferredBuf. Co-Authored-By: Claude Opus 4.6 --- delphi/KPANSI.PAS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/delphi/KPANSI.PAS b/delphi/KPANSI.PAS index 3a7d41f..7fb5db3 100644 --- a/delphi/KPANSI.PAS +++ b/delphi/KPANSI.PAS @@ -2188,6 +2188,13 @@ begin SelectObject(FLiveDC, FPaintFont); SetBkMode(FLiveDC, OPAQUE); FlushPendingScrolls; + { Dirty old cursor row to erase ghost when cursor moved between rows } + if FCursorRow <> FLastCursorRow then + begin + if (FLastCursorRow >= 0) and (FLastCursorRow < FRows) then + FDirtyRow[FLastCursorRow] := True; + FDirtyRow[FCursorRow] := True; + end; for Row := 0 to FRows - 1 do begin if FAllDirty or FDirtyRow[Row] then