diff options
author | Tony Chen <tchen1998@gmail.com> | 2022-04-02 12:35:33 -0400 |
---|---|---|
committer | Tony Chen <tchen1998@gmail.com> | 2022-04-02 12:35:33 -0400 |
commit | ea71c26ec922a80cf2f05d5bc553dc70f0e130f0 (patch) | |
tree | 99d58660862f2aa2360cab04169407dafc9d4f89 | |
parent | 2a466001401c5a6d67ca9e33ae9630939150d09f (diff) | |
download | rneovim-ea71c26ec922a80cf2f05d5bc553dc70f0e130f0.tar.gz rneovim-ea71c26ec922a80cf2f05d5bc553dc70f0e130f0.tar.bz2 rneovim-ea71c26ec922a80cf2f05d5bc553dc70f0e130f0.zip |
fix(extmarks): splice extmarks on accepting spell
-rw-r--r-- | src/nvim/spell.c | 2 | ||||
-rw-r--r-- | test/functional/lua/buffer_updates_spec.lua | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index fb644daa39..e65ca2e6a6 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -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; } diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index c83a50b78b..cbd78ccd53 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -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() |