fix(extmark): builtin completion can still affect nearby extmarks #31387

Problem:
Built-in completion can still affect nearby extmarks. #31384

Solution:
Restore extmarks when completion leader changes.
This commit is contained in:
luukvbaal 2024-12-02 15:11:38 +01:00 committed by GitHub
parent 9d0117fd30
commit c7ec010ade
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -1805,6 +1805,7 @@ static void ins_compl_new_leader(void)
ins_compl_del_pum();
ins_compl_delete();
ins_bytes(compl_leader + get_compl_len());
restore_orig_extmarks();
compl_used_match = false;
if (compl_started) {

View File

@ -1302,5 +1302,15 @@ describe('completion', function()
aaaaa |
{5:-- INSERT --} |
]])
-- Also when completion leader is changed #31384
feed('<Esc>hi<C-N><C-P>a')
screen:expect({
grid = [[
{9:aa}a^aa |
{4:aaaa } |
{4:aaaaa } |
{5:-- Keyword completion (^N^P) }{19:Back at original} |
]],
})
end)
end)