mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
adapt to the style guildelines
semi-automated harvest of low hanging fruit: change the unorthodox use of whitespace.
This commit is contained in:

committed by
Thiago de Arruda

parent
59f2430a8d
commit
edabc6f4c7
34
src/menu.c
34
src/menu.c
@@ -137,7 +137,7 @@ ex_menu (
|
||||
++arg;
|
||||
}
|
||||
arg = skipwhite(arg);
|
||||
} else if (eap->addr_count && eap->line2 != 0) {
|
||||
} else if (eap->addr_count && eap->line2 != 0) {
|
||||
pri_tab[0] = eap->line2;
|
||||
i = 1;
|
||||
} else
|
||||
@@ -152,7 +152,7 @@ ex_menu (
|
||||
if (STRNCMP(arg, "enable", 6) == 0 && vim_iswhite(arg[6])) {
|
||||
enable = TRUE;
|
||||
arg = skipwhite(arg + 6);
|
||||
} else if (STRNCMP(arg, "disable", 7) == 0 && vim_iswhite(arg[7])) {
|
||||
} else if (STRNCMP(arg, "disable", 7) == 0 && vim_iswhite(arg[7])) {
|
||||
enable = FALSE;
|
||||
arg = skipwhite(arg + 7);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ ex_menu (
|
||||
if (*map_to == NUL && !unmenu && enable == MAYBE) {
|
||||
show_menus(menu_path, modes);
|
||||
goto theend;
|
||||
} else if (*map_to != NUL && (unmenu || enable != MAYBE)) {
|
||||
} else if (*map_to != NUL && (unmenu || enable != MAYBE)) {
|
||||
EMSG(_(e_trailing));
|
||||
goto theend;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ ex_menu (
|
||||
}
|
||||
}
|
||||
menu_nable_recurse(root_menu, menu_path, modes, enable);
|
||||
} else if (unmenu) {
|
||||
} else if (unmenu) {
|
||||
/*
|
||||
* Delete menu(s).
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ ex_menu (
|
||||
|
||||
/* Careful: remove_menu() changes menu_path */
|
||||
remove_menu(&root_menu, menu_path, modes, FALSE);
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* Add menu(s).
|
||||
* Replace special key codes.
|
||||
@@ -383,7 +383,7 @@ add_menu_path (
|
||||
if (en_name != NULL) {
|
||||
menu->en_name = vim_strsave(en_name);
|
||||
menu->en_dname = menu_text(en_name, NULL, NULL);
|
||||
} else {
|
||||
} else {
|
||||
menu->en_name = NULL;
|
||||
menu->en_dname = NULL;
|
||||
}
|
||||
@@ -398,7 +398,7 @@ add_menu_path (
|
||||
|
||||
old_modes = 0;
|
||||
|
||||
} else {
|
||||
} else {
|
||||
old_modes = menu->modes;
|
||||
|
||||
/*
|
||||
@@ -609,7 +609,7 @@ remove_menu (
|
||||
#endif
|
||||
if (remove_menu(&menu->children, p, modes, silent) == FAIL)
|
||||
return FAIL;
|
||||
} else if (*name != NUL) {
|
||||
} else if (*name != NUL) {
|
||||
if (!silent)
|
||||
EMSG(_(e_othermode));
|
||||
return FAIL;
|
||||
@@ -742,7 +742,7 @@ static int show_menus(char_u *path_name, int modes)
|
||||
EMSG(_(e_notsubmenu));
|
||||
vim_free(path_name);
|
||||
return FAIL;
|
||||
} else if ((menu->modes & modes) == 0x0) {
|
||||
} else if ((menu->modes & modes) == 0x0) {
|
||||
EMSG(_(e_othermode));
|
||||
vim_free(path_name);
|
||||
return FAIL;
|
||||
@@ -824,7 +824,7 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
|
||||
else
|
||||
msg_outtrans_special(menu->strings[bit], FALSE);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (menu == NULL) {
|
||||
menu = root_menu;
|
||||
depth--;
|
||||
@@ -1036,7 +1036,7 @@ char_u *get_menu_names(expand_T *xp, int idx)
|
||||
* so that '.' in names gets escaped properly */
|
||||
STRCAT(tbuffer, "\001");
|
||||
str = tbuffer;
|
||||
} else {
|
||||
} else {
|
||||
if (should_advance)
|
||||
str = menu->en_dname;
|
||||
else {
|
||||
@@ -1322,7 +1322,7 @@ void ex_emenu(exarg_T *eap)
|
||||
if (*p == NUL && menu->children != NULL) {
|
||||
EMSG(_("E333: Menu path must lead to a menu item"));
|
||||
menu = NULL;
|
||||
} else if (*p != NUL && menu->children == NULL) {
|
||||
} else if (*p != NUL && menu->children == NULL) {
|
||||
EMSG(_(e_notsubmenu));
|
||||
menu = NULL;
|
||||
}
|
||||
@@ -1348,7 +1348,7 @@ void ex_emenu(exarg_T *eap)
|
||||
) {
|
||||
mode = (char_u *)"Insert";
|
||||
idx = MENU_INDEX_INSERT;
|
||||
} else if (eap->addr_count) {
|
||||
} else if (eap->addr_count) {
|
||||
pos_T tpos;
|
||||
|
||||
mode = (char_u *)"Visual";
|
||||
@@ -1365,7 +1365,7 @@ void ex_emenu(exarg_T *eap)
|
||||
tpos = curbuf->b_visual.vi_end;
|
||||
curwin->w_cursor = curbuf->b_visual.vi_start;
|
||||
curwin->w_curswant = curbuf->b_visual.vi_curswant;
|
||||
} else {
|
||||
} else {
|
||||
/* Set it up for line-wise visual mode */
|
||||
VIsual_mode = 'V';
|
||||
curwin->w_cursor.lnum = eap->line1;
|
||||
@@ -1388,7 +1388,7 @@ void ex_emenu(exarg_T *eap)
|
||||
* for exclusive mode */
|
||||
if (*p_sel == 'e' && gchar_cursor() != NUL)
|
||||
++curwin->w_cursor.col;
|
||||
} else {
|
||||
} else {
|
||||
mode = (char_u *)"Normal";
|
||||
idx = MENU_INDEX_NORMAL;
|
||||
}
|
||||
@@ -1503,7 +1503,7 @@ void ex_menutranslate(exarg_T *eap)
|
||||
ga_clear(&menutrans_ga);
|
||||
/* Delete all "menutrans_" global variables. */
|
||||
del_menutrans_vars();
|
||||
} else {
|
||||
} else {
|
||||
/* ":menutrans from to": add translation */
|
||||
from = arg;
|
||||
arg = menu_skip_part(arg);
|
||||
@@ -1528,7 +1528,7 @@ void ex_menutranslate(exarg_T *eap)
|
||||
tp[menutrans_ga.ga_len].from_noamp = from_noamp;
|
||||
tp[menutrans_ga.ga_len].to = to;
|
||||
++menutrans_ga.ga_len;
|
||||
} else {
|
||||
} else {
|
||||
vim_free(from);
|
||||
vim_free(from_noamp);
|
||||
vim_free(to);
|
||||
|
Reference in New Issue
Block a user