mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-31 14:07:06 -06:00
Paragraph commands (align, case, insert, paste, selectParagraph) iterated for pi in a.0..=b.0 with both ends taken verbatim from text.select, so a control-channel selection with caret u64::MAX spun the loop over 2^64 entries on the UI thread, and text.selectParagraph's at.0 + 1 overflow- panicked in debug builds. Clamp every range at the body's last paragraph and use saturating_add for the single-index arithmetic. Regression test: paragraph_commands_clamp_a_hostile_text_selection — fails on main with 'attempt to add with overflow' at cmd/text.rs:1151, passes with the clamp.