Entry snapshots state for the history buffer, cloning store and spans so later edits to the live promptInput don't mutate the recorded entry.
()
| 501 | // Entry snapshots state for the history buffer, cloning store and spans so |
| 502 | // later edits to the live promptInput don't mutate the recorded entry. |
| 503 | func (p promptInput) Entry() promptEntry { |
| 504 | return promptEntry{ |
| 505 | display: p.ta.Value(), |
| 506 | store: maps.Clone(p.store), |
| 507 | spans: slices.Clone(p.spans), |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | // Restore replays a history entry: sets the display text, installs the |
| 512 | // snapshot's chip state, drops the cursor at the end. |