diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 98c68b8783f6..305cc31e719d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3487,7 +3487,12 @@ enum Paste { } fn paste_impl(values: &[String], doc: &mut Document, view: &mut View, action: Paste, count: usize) { + if values.is_empty() { + return; + } + let repeat = std::iter::repeat( + // `values` is asserted to have at least one entry above. values .last() .map(|value| Tendril::from(value.repeat(count)))