aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/menu.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-14 21:36:15 +0800
committerGitHub <noreply@github.com>2023-01-14 21:36:15 +0800
commit2065ce877ef81bcd66132bd26e75aa4d761dca12 (patch)
tree875ab83390eb34fc6d85b5b43c35600166eac56d /src/nvim/menu.c
parentd549734fb4792bcdb5395006538f7c6d856252e7 (diff)
downloadrneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.tar.gz
rneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.tar.bz2
rneovim-2065ce877ef81bcd66132bd26e75aa4d761dca12.zip
vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11813) https://github.com/vim/vim/commit/e8575988969579f9e1439181ae338b2ff74054a8 Partial port as this depends on some previous eval and 'smoothscroll' patches. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r--src/nvim/menu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 000377a997..0fa45ac24a 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -1449,9 +1449,11 @@ void show_popupmenu(void)
}
// Only show a popup when it is defined and has entries
- if (menu != NULL && menu->children != NULL) {
- pum_show_popupmenu(menu);
+ if (menu == NULL || menu->children == NULL) {
+ return;
}
+
+ pum_show_popupmenu(menu);
}
/// Execute "menu". Use by ":emenu" and the window toolbar.