on master help sign in
Fix panic on paste from blackhole register (#4497)
3814987Michael Davis
helix-term/src/commands.rs+5
@@ -3447,7 +3447,12 @@ enum Paste {
3447}
3447}
3448
3448
3449fn paste_impl(values: &[String], doc: &mut Document, view: &mut View, action: Paste, count: usize) {
3449fn paste_impl(values: &[String], doc: &mut Document, view: &mut View, action: Paste, count: usize) {
3450+ if values.is_empty() {
3451+ return;
3452+ }
3453+
3450 let repeat = std::iter::repeat(
3454 let repeat = std::iter::repeat(
3455+ // `values` is asserted to have at least one entry above.
3451 values
3456 values
3452 .last()
3457 .last()
3453 .map(|value| Tendril::from(value.repeat(count)))
3458 .map(|value| Tendril::from(value.repeat(count)))