diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-01-26 21:55:45 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-27 00:51:58 +0100 |
commit | d760e08facda964c04c08d589135cd6b53e16196 (patch) | |
tree | 913683c743390ee232f9509c47b7939c155484ba /src | |
parent | 827ed144fb4cfafd2727f55e6b25e07c96962138 (diff) | |
download | rneovim-d760e08facda964c04c08d589135cd6b53e16196.tar.gz rneovim-d760e08facda964c04c08d589135cd6b53e16196.tar.bz2 rneovim-d760e08facda964c04c08d589135cd6b53e16196.zip |
menu_get(): Do not include empty items
Caused by a typo: `dict` instead of `dic`. Renamed variable to `d` to
make it less similar.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/menu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 0183f1d276..805952f395 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -660,7 +660,8 @@ static void free_menu_string(vimmenu_T *menu, int idx) /// /// @param[in] menu if null, starts from root_menu /// @param modes, a choice of \ref MENU_MODES -/// @return a dict with name/commands +/// @return dict with name/commands +/// @see show_menus_recursive /// @see menu_get static dict_T *menu_get_recursive(const vimmenu_T *menu, int modes) { @@ -715,10 +716,10 @@ static dict_T *menu_get_recursive(const vimmenu_T *menu, int modes) // visit recursively all children list_T *const children_list = tv_list_alloc(kListLenMayKnow); for (menu = menu->children; menu != NULL; menu = menu->next) { - dict_T *dic = menu_get_recursive(menu, modes); - if (tv_dict_len(dict) > 0) { - tv_list_append_dict(children_list, dic); - } + dict_T *d = menu_get_recursive(menu, modes); + if (tv_dict_len(d) > 0) { + tv_list_append_dict(children_list, d); + } } tv_dict_add_list(dict, S_LEN("submenus"), children_list); } |