mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
Fix line-wise p
pasting before the current line instead of after.
This commit is contained in:
parent
1910fa7723
commit
e8a3980e46
@ -3093,7 +3093,10 @@ fn paste_impl(
|
|||||||
// paste linewise before
|
// paste linewise before
|
||||||
(Paste::Before, true) => text.line_to_char(text.char_to_line(range.from())),
|
(Paste::Before, true) => text.line_to_char(text.char_to_line(range.from())),
|
||||||
// paste linewise after
|
// paste linewise after
|
||||||
(Paste::After, true) => text.line_to_char(text.char_to_line(range.to())),
|
(Paste::After, true) => {
|
||||||
|
let idx = range.to().saturating_sub(1).max(range.from());
|
||||||
|
text.line_to_char((text.char_to_line(idx) + 1).min(text.len_lines()))
|
||||||
|
}
|
||||||
// paste insert
|
// paste insert
|
||||||
(Paste::Before, false) => range.from(),
|
(Paste::Before, false) => range.from(),
|
||||||
// paste append
|
// paste append
|
||||||
|
Loading…
Reference in New Issue
Block a user