mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
completion: fix segfault with ignorecase+infercase (#6452)
Helped-by: Matthew Malcomson <hardenedapple@gmail.com> Closes #6451
This commit is contained in:
@@ -2109,7 +2109,7 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
|
|||||||
|
|
||||||
xfree(wca);
|
xfree(wca);
|
||||||
|
|
||||||
return ins_compl_add(IObuff, len, icase, fname, NULL, true, dir, flags,
|
return ins_compl_add(IObuff, len, icase, fname, NULL, false, dir, flags,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
return ins_compl_add(str, len, icase, fname, NULL, false, dir, flags, false);
|
return ins_compl_add(str, len, icase, fname, NULL, false, dir, flags, false);
|
||||||
@@ -2146,7 +2146,7 @@ static int ins_compl_add(char_u *const str, int len,
|
|||||||
os_breakcheck();
|
os_breakcheck();
|
||||||
#define FREE_CPTEXT(cptext, cptext_allocated) \
|
#define FREE_CPTEXT(cptext, cptext_allocated) \
|
||||||
do { \
|
do { \
|
||||||
if (cptext_allocated) { \
|
if (cptext != NULL && cptext_allocated) { \
|
||||||
for (size_t i = 0; i < CPT_COUNT; i++) { \
|
for (size_t i = 0; i < CPT_COUNT; i++) { \
|
||||||
xfree(cptext[i]); \
|
xfree(cptext[i]); \
|
||||||
} \
|
} \
|
||||||
|
@@ -850,6 +850,22 @@ describe('completion', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("'ignorecase' 'infercase' CTRL-X CTRL-N #6451", function()
|
||||||
|
execute('set ignorecase infercase')
|
||||||
|
execute('edit BACKERS.md')
|
||||||
|
feed('oX<C-X><C-N>')
|
||||||
|
screen:expect([[
|
||||||
|
# Bountysource Backers |
|
||||||
|
Xnull^ |
|
||||||
|
{2:Xnull }{6: } |
|
||||||
|
{1:Xoxomoon }{6: }ryone who backed our [Bountysource fundraise|
|
||||||
|
{1:Xu }{6: }ountysource.com/teams/neovim/fundraiser)! |
|
||||||
|
{1:Xpayn }{2: } |
|
||||||
|
{1:Xinity }{2: }d URL in BACKERS.md. |
|
||||||
|
{3:-- Keyword Local completion (^N^P) }{4:match 1 of 7} |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('External completion popupmenu', function()
|
describe('External completion popupmenu', function()
|
||||||
|
Reference in New Issue
Block a user