DashboardopencodelinePage trailing newline

linePage trailing newline

Category: gotcha
Confidence: 1.00
ID: 01a07f11-757b-7084-8cb0-cc8e8c68b497
Project ID: c0425955-02bc-4c17-9af2-b114c00077e7
Cross-project: No
Recalled in other projects: 0
Source session: 0bvvC1dq8qm5Ru8hT
Created: 2026-09-08 03:30:45
Updated: 2026-09-08 03:30:45

Content

Trap: iterating through index <= input.length looks necessary to emit the final line, but empty buffers and output ending in \n gain a phantom empty line that disagrees with lineCount and continuation offsets. Fix: define one trailing-newline policy and make paging, counts, line numbers, and next-offset metadata use it consistently.

Move to: