Skip to content

Commit

Permalink
fix(extmarks): splice extmarks on accepting spell
Browse files Browse the repository at this point in the history
  • Loading branch information
chentoast committed Apr 2, 2022
1 parent 2a46600 commit ea71c26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvim/spell.c
Expand Up @@ -3066,7 +3066,7 @@ void spell_suggest(int count)
ml_replace(curwin->w_cursor.lnum, p, false);
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 {
curwin->w_cursor = prev_cursor;
}
Expand Down
9 changes: 9 additions & 0 deletions test/functional/lua/buffer_updates_spec.lua
Expand Up @@ -1104,6 +1104,15 @@ describe('lua: nvim_buf_attach on_bytes', function()
check_events { }
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 description = (mode ~= "") and mode or "(baseline)"
it("test_lockmarks " .. description .. " %delete _", function()
Expand Down

0 comments on commit ea71c26

Please sign in to comment.