Fix yank around paragraph missing newline (#43583)

Use `MotionKind::LineWise` in both
`vim::normal::change::Vim.change_object` and
`vim::normal::yank::Vim.yank_object` when dealing with objects that
target `Mode::VisualLine`, for example, paragraphs. This fixes an issue
where yanking and changing paragraphs would not include the trailing
newline character.

Closes #28804

Release Notes:

- Fixed linewise text object operations (`yap`, `cap`, etc.) omitting
trailing blank line in vim mode

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
This commit is contained in:
Ramon
2025-12-03 17:11:53 +00:00
committed by GitHub
co-authored by dino
parent 85ccd7c98b
commit 575ea49aad
5 changed files with 101 additions and 2 deletions
@@ -0,0 +1,8 @@
{"Put":{"state":"first paragraph\nˇstill first\n\nsecond paragraph\nstill second\n\nthird paragraph\n"}}
{"Key":"c"}
{"Key":"a"}
{"Key":"p"}
{"Get":{"state":"ˇ\nsecond paragraph\nstill second\n\nthird paragraph\n","mode":"Insert"}}
{"ReadRegister":{"name":"\"","value":"first paragraph\nstill first\n\n"}}
{"Key":"escape"}
{"Get":{"state":"ˇ\nsecond paragraph\nstill second\n\nthird paragraph\n","mode":"Normal"}}
@@ -0,0 +1,10 @@
{"Put":{"state":"first paragraph\nˇstill first\n\nsecond paragraph\nstill second\n\nthird paragraph\n"}}
{"Key":"y"}
{"Key":"a"}
{"Key":"p"}
{"Get":{"state":"ˇfirst paragraph\nstill first\n\nsecond paragraph\nstill second\n\nthird paragraph\n","mode":"Normal"}}
{"ReadRegister":{"name":"\"","value":"first paragraph\nstill first\n\n"}}
{"Key":"j"}
{"Key":"j"}
{"Key":"p"}
{"Get":{"state":"first paragraph\nstill first\n\nˇfirst paragraph\nstill first\n\nsecond paragraph\nstill second\n\nthird paragraph\n","mode":"Normal"}}