From 0c8454f5bc5c40a2d2926f4b630a8519731fd7ae Mon Sep 17 00:00:00 2001 From: glacambre Date: Tue, 25 May 2021 07:06:50 +0200 Subject: Fix crash on `:echo get_all_options_info()` Iterating over PARAM_COUNT is wrong as PARAM_COUNT also counts the last element of the options array, which has a NULL fullname in order to signal the end of the array. --- test/functional/api/vim_spec.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 6926022ee3..0c0f610401 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1986,6 +1986,10 @@ describe('API', function() eq(meths.get_option_info'winhighlight', options_info.winhighlight) end) + + it('should not crash when echoed', function() + meths.exec("echo nvim_get_all_options_info()", true) + end) end) describe('nvim_get_option_info', function() -- cgit