Merge pull request #17971 from chentau/extmark_spell

fix(extmarks): splice extmarks on accepting spell
This commit is contained in:
bfredl 2022-04-08 19:09:48 +02:00 committed by GitHub
commit b4ec6af12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -3066,7 +3066,7 @@ void spell_suggest(int count)
ml_replace(curwin->w_cursor.lnum, p, false); ml_replace(curwin->w_cursor.lnum, p, false);
curwin->w_cursor.col = c; curwin->w_cursor.col = c;
changed_bytes(curwin->w_cursor.lnum, c); inserted_bytes(curwin->w_cursor.lnum, c, stp->st_orglen, stp->st_wordlen);
} else { } else {
curwin->w_cursor = prev_cursor; curwin->w_cursor = prev_cursor;
} }

View File

@ -1104,6 +1104,15 @@ describe('lua: nvim_buf_attach on_bytes', function()
check_events { } check_events { }
end) end)
it("works with accepting spell suggestions", function()
local check_events = setup_eventcheck(verify, {"hallo"})
feed("gg0z=4<cr><cr>") -- accepts 'Hello'
check_events {
{ "test1", "bytes", 1, 3, 0, 0, 0, 0, 2, 2, 0, 2, 2 };
}
end)
local function test_lockmarks(mode) local function test_lockmarks(mode)
local description = (mode ~= "") and mode or "(baseline)" local description = (mode ~= "") and mode or "(baseline)"
it("test_lockmarks " .. description .. " %delete _", function() it("test_lockmarks " .. description .. " %delete _", function()