Protect an extended window
A Go code buffer extends ranges and reuses storage for unread codes and incoming chunks.
What needs to change
Repair extendWindow so the extended selected window satisfies the source-preservation contract.
Reproduce
- Run go run main.go with the supplied input and compare owner and edited-window reports.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
main.go supplies valid start/end bounds and the appended code.
The source buffer must retain its values. The caller then changes the returned window’s first value and reports both source and result.
Supplied input is well formed: 0<=seed count<=capacity<=64; both range pairs satisfy 0<=start<=end<=seed count; code and seed values are integers in -1000..1000. The caller assumes this domain rather than validating it.