mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
Merge pull request #13842 from vigoux/update-last-line
fix(buf_updates): send updates when putting past last line
This commit is contained in:
commit
38ea2ce342
@ -3422,15 +3422,11 @@ error:
|
||||
if (dir == FORWARD)
|
||||
curbuf->b_op_start.lnum++;
|
||||
}
|
||||
// Skip mark_adjust when adding lines after the last one, there
|
||||
// can't be marks there.
|
||||
if (curbuf->b_op_start.lnum + (y_type == kMTCharWise) - 1 + nr_lines
|
||||
< curbuf->b_ml.ml_line_count) {
|
||||
ExtmarkOp kind = (y_type == kMTLineWise && !(flags & PUT_LINE_SPLIT))
|
||||
? kExtmarkUndo : kExtmarkNOOP;
|
||||
mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
|
||||
(linenr_T)MAXLNUM, nr_lines, 0L, kind);
|
||||
}
|
||||
|
||||
ExtmarkOp kind = (y_type == kMTLineWise && !(flags & PUT_LINE_SPLIT))
|
||||
? kExtmarkUndo : kExtmarkNOOP;
|
||||
mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
|
||||
(linenr_T)MAXLNUM, nr_lines, 0L, kind);
|
||||
|
||||
// note changed text for displaying and folding
|
||||
if (y_type == kMTCharWise) {
|
||||
|
@ -507,6 +507,20 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
||||
|
||||
end)
|
||||
|
||||
it("linewise paste", function()
|
||||
local check_events = setup_eventcheck(verify, origlines)
|
||||
|
||||
feed'yyp'
|
||||
check_events {
|
||||
{ "test1", "bytes", 1, 3, 1, 0, 16, 0, 0, 0, 1, 0, 16 };
|
||||
}
|
||||
|
||||
feed'Gyyp'
|
||||
check_events {
|
||||
{ "test1", "bytes", 1, 4, 8, 0, 130, 0, 0, 0, 1, 0, 18 };
|
||||
}
|
||||
end)
|
||||
|
||||
it('inccomand=nosplit and substitute', function()
|
||||
if verify then pending("Verification can't be done when previewing") end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user