aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/menu.c
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2021-05-20 21:15:31 +0800
committerkevinhwang91 <kevin.hwang@live.com>2021-05-20 21:15:31 +0800
commitd29148ffd812058cf7281607d1b6a9dd937d5d6c (patch)
tree8dc16d1b0949b0093a3fd71991ac3ed438fca4d6 /src/nvim/menu.c
parent2dc0f812710b19f8befcfa64ef9335cadc510296 (diff)
parent5d9c5601275abfa17396b3a80c7b958c48080807 (diff)
downloadrneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.tar.gz
rneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.tar.bz2
rneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.zip
Merge remote-tracking branch 'origin/master' into qftf
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r--src/nvim/menu.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index ac3b7768e6..112f51fc64 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -1069,7 +1069,7 @@ char_u *get_menu_names(expand_T *xp, int idx)
#define TBUFFER_LEN 256
static char_u tbuffer[TBUFFER_LEN]; /*hack*/
char_u *str;
- static int should_advance = FALSE;
+ static bool should_advance = false;
if (idx == 0) { /* first call: start at first item */
menu = expand_menu;
@@ -1089,12 +1089,13 @@ char_u *get_menu_names(expand_T *xp, int idx)
if (menu->modes & expand_modes) {
if (menu->children != NULL) {
- if (should_advance)
- STRLCPY(tbuffer, menu->en_dname, TBUFFER_LEN - 1);
- else {
- STRLCPY(tbuffer, menu->dname, TBUFFER_LEN - 1);
- if (menu->en_dname == NULL)
- should_advance = TRUE;
+ if (should_advance) {
+ STRLCPY(tbuffer, menu->en_dname, TBUFFER_LEN);
+ } else {
+ STRLCPY(tbuffer, menu->dname, TBUFFER_LEN);
+ if (menu->en_dname == NULL) {
+ should_advance = true;
+ }
}
/* hack on menu separators: use a 'magic' char for the separator
* so that '.' in names gets escaped properly */
@@ -1105,8 +1106,9 @@ char_u *get_menu_names(expand_T *xp, int idx)
str = menu->en_dname;
else {
str = menu->dname;
- if (menu->en_dname == NULL)
- should_advance = TRUE;
+ if (menu->en_dname == NULL) {
+ should_advance = true;
+ }
}
}
} else