on master help sign in
Fix line-wise `p` pasting before the current line instead of after.
e8a3980Nathan Vegdahl
helix-term/src/commands.rs+4−1
@@ -3093,7 +3093,10 @@ fn paste_impl(
3093 // paste linewise before
3093 // paste linewise before
3094 (Paste::Before, true) => text.line_to_char(text.char_to_line(range.from())),
3094 (Paste::Before, true) => text.line_to_char(text.char_to_line(range.from())),
3095 // paste linewise after
3095 // paste linewise after
3096+ (Paste::After, true) => {
3097+ let idx = range.to().saturating_sub(1).max(range.from());
3096− (Paste::After, true) => text.line_to_char(text.char_to_line(range.to())),
3098+ text.line_to_char((text.char_to_line(idx) + 1).min(text.len_lines()))
3099+ }
3097 // paste insert
3100 // paste insert
3098 (Paste::Before, false) => range.from(),
3101 (Paste::Before, false) => range.from(),
3099 // paste append
3102 // paste append