mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
Merge pull request #14607 from glacambre/fix_get_all_options_info_crash
[RDY] Generate PARAM_COUNT macro
This commit is contained in:
@@ -7705,7 +7705,7 @@ Dictionary get_vimoption(String name, Error *err)
|
|||||||
Dictionary get_all_vimoptions(void)
|
Dictionary get_all_vimoptions(void)
|
||||||
{
|
{
|
||||||
Dictionary retval = ARRAY_DICT_INIT;
|
Dictionary retval = ARRAY_DICT_INIT;
|
||||||
for (size_t i = 0; i < PARAM_COUNT; i++) {
|
for (size_t i = 0; options[i].fullname != NULL; i++) {
|
||||||
Dictionary opt_dict = vimoption2dict(&options[i]);
|
Dictionary opt_dict = vimoption2dict(&options[i]);
|
||||||
PUT(retval, options[i].fullname, DICTIONARY_OBJ(opt_dict));
|
PUT(retval, options[i].fullname, DICTIONARY_OBJ(opt_dict));
|
||||||
}
|
}
|
||||||
|
@@ -1986,6 +1986,10 @@ describe('API', function()
|
|||||||
|
|
||||||
eq(meths.get_option_info'winhighlight', options_info.winhighlight)
|
eq(meths.get_option_info'winhighlight', options_info.winhighlight)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('should not crash when echoed', function()
|
||||||
|
meths.exec("echo nvim_get_all_options_info()", true)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('nvim_get_option_info', function()
|
describe('nvim_get_option_info', function()
|
||||||
|
Reference in New Issue
Block a user