P2: later
An appendix to the milestone.
P2: later
-
Stack copies in a program documented to run on one page of stack. Finding:
yankcopies the whole 256-byte kill buffer to the stack to satisfy the borrow checker where disjoint field borrows would do;LineDisc::restorebuilds a 256-byte local for each of eight history entries in turn;RawQueue::savebuilds a 64-byte local. The doc onnewexplains the editor lives in astaticbecause the stack is one 4 KiB page. Evidence:src/line_disc.rslines 157 to 160 and 552;src/handoff.rslines 135 and 147. Change: borrowself.bufandself.killas two fields; letReader::fieldwrite into the history entry in place. Door: two-way. Effort: S. -
csi_moveholds a bound nothing states. Finding: its 11-byte sequence buffer fits eight decimal digits; every caller passes a count at mostLINE_MAXIMUM, which is three digits, and no assertion or comment ties the two. Evidence:src/line_disc.rslines 652 to 673. Change: adebug_assert!(n <= LINE_MAXIMUM)or a buffer sized from the constant. Door: two-way. Effort: S. -
Three repaints with one body. Finding:
start_line,repaintandclear_and_repainteach emit prompt, line, and a cursor step back; only the preface differs. Evidence:src/line_disc.rslines 226 to 241 and 435 to 440. Change: the two callers callrepaint. Door: two-way. Effort: S. -
History is eight lines, fixed, and the kill ring is one entry. Finding: linenoise defaults to 100 entries and
rustylineto a configurable size; the ring here isHISTentries ofLINE_MAXIMUMbytes each, 2 KiB, which is right for the one-page process and small for a desk session. Dedup looks only at the newest entry. Evidence:src/line_disc.rslines 17 and 137. Change: state it inBUGSnow; a const generic on the history depth later, if a second user asks. Door: two-way until a const generic lands, then one-way. Effort: S now. -
The test terminal model panics on a cursor past the row. Finding:
Screen::interpretindexesrow[col]whencolis at mostrow.len(); aCSI n Cpast the end followed by a printable byte would panic with an index error rather than a message naming the sequence. The engine never does it today. Evidence:src/test_support.rslines 66 to 74. Change: pad the row or assert with a message. Door: two-way. Effort: S. -
Writer::fieldtruncates a length tou32by cast. Finding:b.len() as u32cannot overflow for any field this crate writes (at most 256 bytes), and au32::try_fromthat setsfullwould make the writer refuse rather than wrap if a larger caller ever appears. Evidence:src/handoff.rsline 45. Change:try_from, withfull = trueon failure. Door: two-way. Effort: S.