patch 9.1.1390: style: more wrong indentation
Problem: style: more wrong indentation
Solution: reformat a few more places
(Yegappan Lakshmanan)
closes: #17309
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index f7d3ac8..a6d8c85 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -4386,10 +4386,10 @@
}
if (cmdline_fuzzy_completion_supported(&xpc))
- // when fuzzy matching, don't modify the search string
- pat = vim_strsave(xpc.xp_pattern);
+ // when fuzzy matching, don't modify the search string
+ pat = vim_strsave(xpc.xp_pattern);
else
- pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
+ pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
if (rettv_list_alloc(rettv) == OK && pat != NULL)
{
diff --git a/src/debugger.c b/src/debugger.c
index 5508ea3..cb0b86f 100644
--- a/src/debugger.c
+++ b/src/debugger.c
@@ -395,9 +395,9 @@
}
if (SOURCING_LNUM != 0)
- smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd);
+ smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd);
else
- smsg(_("cmd: %s"), cmd);
+ smsg(_("cmd: %s"), cmd);
}
/*
diff --git a/src/diff.c b/src/diff.c
index ec108e9..171bffb 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -781,7 +781,7 @@
char_u *ptr;
if (end < 0)
- end = buf->b_ml.ml_line_count;
+ end = buf->b_ml.ml_line_count;
if (buf->b_ml.ml_flags & ML_EMPTY)
{
@@ -2395,10 +2395,10 @@
if (lnum >= wp->w_topline && lnum < wp->w_botline
&& !dp->is_linematched && diff_linematch(dp)
&& diff_check_sanity(curtab, dp))
- run_linematch_algorithm(dp);
+ run_linematch_algorithm(dp);
if (dp->is_linematched)
- return linematched_filler_lines(dp, idx, lnum, linestatus);
+ return linematched_filler_lines(dp, idx, lnum, linestatus);
if (lnum < dp->df_lnum[idx] + dp->df_count[idx])
{
diff --git a/src/dosinst.c b/src/dosinst.c
index 116cc8f..3c2dc15 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -2695,8 +2695,8 @@
printf("\n\nInstall will do for you:\n");
for (i = 0; i < choice_count; ++i)
- if (choices[i].active)
- printf("%2d %s\n", i + 1, choices[i].text);
+ if (choices[i].active)
+ printf("%2d %s\n", i + 1, choices[i].text);
printf("To change an item, enter its number\n\n");
printf("Enter item number, h (help), d (do it) or q (quit): ");
}
diff --git a/src/evalwindow.c b/src/evalwindow.c
index f8b903d..613df0f 100644
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -106,8 +106,8 @@
}
#ifdef FEAT_PROP_POPUP
// popup windows are in separate lists
- FOR_ALL_TABPAGES(tp)
- FOR_ALL_POPUPWINS_IN_TAB(tp, wp)
+ FOR_ALL_TABPAGES(tp)
+ FOR_ALL_POPUPWINS_IN_TAB(tp, wp)
if (wp->w_id == id)
{
if (tpp != NULL)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0dad7b1..b87e3c7 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -467,36 +467,38 @@
/*
* Check if ffname differs from fnum.
- * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid buffer ID.
+ * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid
+ * buffer ID.
* ffname is a full path to where a buffer lives on-disk or would live on-disk.
*
*/
static int
is_other_file(int fnum, char_u *ffname)
{
- if (fnum != 0)
- {
- if (fnum == curbuf->b_fnum)
- return FALSE;
+ if (fnum != 0)
+ {
+ if (fnum == curbuf->b_fnum)
+ return FALSE;
- return TRUE;
- }
+ return TRUE;
+ }
- if (ffname == NULL)
- return TRUE;
+ if (ffname == NULL)
+ return TRUE;
- if (*ffname == NUL)
- return FALSE;
+ if (*ffname == NUL)
+ return FALSE;
- // TODO: Need a reliable way to know whether a buffer is meant to live on-disk
- // !curbuf->b_dev_valid is not always available (example: missing on Windows)
- if (curbuf->b_sfname != NULL
- && *curbuf->b_sfname != NUL)
- // This occurs with unsaved buffers. In which case `ffname`
- // actually corresponds to curbuf->b_sfname
- return fnamecmp(ffname, curbuf->b_sfname) != 0;
+ // TODO: Need a reliable way to know whether a buffer is meant to live
+ // on-disk !curbuf->b_dev_valid is not always available (example: missing
+ // on Windows)
+ if (curbuf->b_sfname != NULL
+ && *curbuf->b_sfname != NUL)
+ // This occurs with unsaved buffers. In which case `ffname` actually
+ // corresponds to curbuf->b_sfname
+ return fnamecmp(ffname, curbuf->b_sfname) != 0;
- return otherfile(ffname);
+ return otherfile(ffname);
}
/*
@@ -2715,7 +2717,7 @@
* Uses a static buffer, only the last error will be kept.
* "msg" will be translated, caller should use N_().
*/
- char *
+ char *
ex_errmsg(char *msg, char_u *arg)
{
vim_snprintf(ex_error_buf, MSG_BUF_LEN, _(msg), arg);
@@ -9330,7 +9332,7 @@
// when called from remote_expr in insert mode, make sure insert mode is
// ended by adding K_NOP to the typeahead buffer
if (vgetc_busy)
- ins_char_typebuf(K_NOP, 0);
+ ins_char_typebuf(K_NOP, 0);
#endif
clearmode();
}
@@ -10375,5 +10377,5 @@
void
set_pressedreturn(int val)
{
- ex_pressedreturn = val;
+ ex_pressedreturn = val;
}
diff --git a/src/ex_getln.c b/src/ex_getln.c
index bbfe1e5..a956023 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -103,7 +103,7 @@
// remove trailing \v and the like
while (len >= 2 && p[len - 2] == '\\'
&& vim_strchr((char_u *)"mMvVcCZ", p[len - 1]) != NULL)
- len -= 2;
+ len -= 2;
// true, if the pattern is empty, or the pattern ends with \| and magic is
// set (or it ends with '|' and very magic is set)
diff --git a/src/findfile.c b/src/findfile.c
index fd2d69f..49def2f 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -162,19 +162,19 @@
*/
typedef struct ff_search_ctx_T
{
- ff_stack_T *ffsc_stack_ptr;
- ff_visited_list_hdr_T *ffsc_visited_list;
- ff_visited_list_hdr_T *ffsc_dir_visited_list;
- ff_visited_list_hdr_T *ffsc_visited_lists_list;
- ff_visited_list_hdr_T *ffsc_dir_visited_lists_list;
- string_T ffsc_file_to_search;
- string_T ffsc_start_dir;
- string_T ffsc_fix_path;
- string_T ffsc_wc_path;
- int ffsc_level;
- string_T *ffsc_stopdirs_v;
- int ffsc_find_what;
- int ffsc_tagfile;
+ ff_stack_T *ffsc_stack_ptr;
+ ff_visited_list_hdr_T *ffsc_visited_list;
+ ff_visited_list_hdr_T *ffsc_dir_visited_list;
+ ff_visited_list_hdr_T *ffsc_visited_lists_list;
+ ff_visited_list_hdr_T *ffsc_dir_visited_lists_list;
+ string_T ffsc_file_to_search;
+ string_T ffsc_start_dir;
+ string_T ffsc_fix_path;
+ string_T ffsc_wc_path;
+ int ffsc_level;
+ string_T *ffsc_stopdirs_v;
+ int ffsc_find_what;
+ int ffsc_tagfile;
} ff_search_ctx_T;
// locally needed functions
diff --git a/src/getchar.c b/src/getchar.c
index c26b442..0d1bd8a 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2604,7 +2604,7 @@
// If memory allocation fails during startup we'll exit but curbuf or
// curwin could be NULL.
if (curbuf == NULL || curwin == NULL)
- return;
+ return;
old_curbuf_fnum = curbuf->b_fnum;
old_curwin_id = curwin->w_id;
diff --git a/src/gui_motif.c b/src/gui_motif.c
index ed721b5..94633b1 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -1377,7 +1377,7 @@
// When GUI hasn't started the menus have not been created.
if (!gui.in_use)
- return;
+ return;
while (menu)
{
diff --git a/src/gui_xim.c b/src/gui_xim.c
index 345b3a4..7703bb7 100644
--- a/src/gui_xim.c
+++ b/src/gui_xim.c
@@ -272,7 +272,7 @@
gui_mch_mousehide(TRUE);
}
- static void
+ static void
im_preedit_window_set_position(void)
{
int x, y, width, height;
diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c
index 3d9519e..440c1b9 100644
--- a/src/gui_xmebw.c
+++ b/src/gui_xmebw.c
@@ -505,7 +505,7 @@
Boolean etched_in;
if (!eb->primitive.shadow_thickness)
- return;
+ return;
if ((eb->core.width <= 2 * eb->primitive.highlight_thickness)
|| (eb->core.height <= 2 * eb->primitive.highlight_thickness))
@@ -748,9 +748,9 @@
static void
Enter(Widget wid,
- XEvent *event,
- String *params UNUSED,
- Cardinal *num_params UNUSED)
+ XEvent *event,
+ String *params UNUSED,
+ Cardinal *num_params UNUSED)
{
XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) wid;
XmPushButtonCallbackStruct call_value;
@@ -837,9 +837,9 @@
static void
Leave(Widget wid,
- XEvent *event,
- String *params UNUSED,
- Cardinal *num_params UNUSED)
+ XEvent *event,
+ String *params UNUSED,
+ Cardinal *num_params UNUSED)
{
XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget)wid;
XmPushButtonCallbackStruct call_value;
diff --git a/src/message.c b/src/message.c
index 376119e..0f799b8 100644
--- a/src/message.c
+++ b/src/message.c
@@ -4172,11 +4172,11 @@
if (!global_busy && !did_warn_clipboard)
{
#ifdef FEAT_CLIPBOARD
- msg(_("W23: Clipboard register not available, using register 0"));
+ msg(_("W23: Clipboard register not available, using register 0"));
#else
- msg(_("W24: Clipboard register not available. See :h W24"));
+ msg(_("W24: Clipboard register not available. See :h W24"));
#endif
- did_warn_clipboard = TRUE;
+ did_warn_clipboard = TRUE;
}
}
diff --git a/src/move.c b/src/move.c
index e3771a5..d27114f 100644
--- a/src/move.c
+++ b/src/move.c
@@ -201,7 +201,7 @@
* Returns the number of columns of overlap with buffer text, excluding the
* extra padding on the ledge.
*/
- int
+ int
sms_marker_overlap(win_T *wp, int extra2)
{
if (extra2 == -1)
diff --git a/src/normal.c b/src/normal.c
index 9231a4c..c631651 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4059,7 +4059,7 @@
#endif
if (!check_can_set_curbuf_disabled())
- return;
+ return;
ptr = grab_file_name(cap->count1, &lnum);
diff --git a/src/optionstr.c b/src/optionstr.c
index f60957e..ce57cb4 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -1864,7 +1864,7 @@
}
# ifdef FEAT_SODIUM
if (crypt_method_is_sodium(crypt_get_method_nr(curbuf)))
- crypt_sodium_lock_key(args->os_newval.string);
+ crypt_sodium_lock_key(args->os_newval.string);
# endif
return NULL;
diff --git a/src/os_unix.c b/src/os_unix.c
index 714f203..f5dea37 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4396,9 +4396,9 @@
if (retval == -1 || ws.ws_col == 0 || ws.ws_row == 0)
{
- cs_out->cs_xpixel = -1;
- cs_out->cs_ypixel = -1;
- return;
+ cs_out->cs_xpixel = -1;
+ cs_out->cs_ypixel = -1;
+ return;
}
// calculate parent tty's pixel per cell.
@@ -6969,9 +6969,9 @@
}
if (shell_style == STYLE_ECHO)
{
- if (strstr((char *)gettail(p_sh), "bash") != NULL)
+ if (strstr((char *)gettail(p_sh), "bash") != NULL)
shell_style = STYLE_GLOBSTAR;
- else if (strstr((char *)gettail(p_sh), "sh") != NULL)
+ else if (strstr((char *)gettail(p_sh), "sh") != NULL)
shell_style = STYLE_VIMGLOB;
}
diff --git a/src/os_vms.c b/src/os_vms.c
index 23854dd..0a67a6b 100644
--- a/src/os_vms.c
+++ b/src/os_vms.c
@@ -686,9 +686,9 @@
}
#ifdef DEBUG
- char *tmpbuf = NULL;
- tmpbuf = ALLOC_MULT(char, buflen);
- strcpy(tmpbuf, instring);
+ char *tmpbuf = NULL;
+ tmpbuf = ALLOC_MULT(char, buflen);
+ strcpy(tmpbuf, instring);
#endif
Fspec_Rms = buf; // for decc$to_vms
diff --git a/src/os_win32.c b/src/os_win32.c
index 0b6fecd..740c35a 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5089,8 +5089,8 @@
// About "Inherit handles" being TRUE: this command can be litigious,
// handle inheritance was deactivated for pending temp file, but, if we
// deactivate it, the pipes don't work for some reason.
- vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE,
- &si, &pi, NULL, NULL);
+ vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE,
+ &si, &pi, NULL, NULL);
if (p != cmd)
vim_free(p);
diff --git a/src/quickfix.c b/src/quickfix.c
index 9c5ad93..d012ea0 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4759,7 +4759,7 @@
* Return the number of the current entry (line number in the quickfix
* window).
*/
- linenr_T
+ linenr_T
qf_current_entry(win_T *wp)
{
qf_info_T *qi = ql_info;
diff --git a/src/regexp.c b/src/regexp.c
index 32a721f..e37dd3c 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -410,15 +410,15 @@
typedef struct
{
- char_u *regparse;
- int prevchr_len;
- int curchr;
- int prevchr;
- int prevprevchr;
- int nextchr;
- int at_start;
- int prev_at_start;
- int regnpar;
+ char_u *regparse;
+ int prevchr_len;
+ int curchr;
+ int prevchr;
+ int prevprevchr;
+ int nextchr;
+ int at_start;
+ int prev_at_start;
+ int regnpar;
} parse_state_T;
static void initchr(char_u *);
@@ -1641,9 +1641,9 @@
{
if (re_multi_type(peekchr()) == MULTI_MULT)
{
- semsg(_(e_nfa_regexp_cannot_repeat_str), what);
- rc_did_emsg = TRUE;
- return FAIL;
+ semsg(_(e_nfa_regexp_cannot_repeat_str), what);
+ rc_did_emsg = TRUE;
+ return FAIL;
}
return OK;
}
diff --git a/src/screen.c b/src/screen.c
index ab37e1d..4fcd9d3 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1580,7 +1580,7 @@
}
#endif
- static void
+ static void
screen_start_highlight(int attr)
{
attrentry_T *aep = NULL;
@@ -1738,7 +1738,7 @@
}
}
- void
+ void
screen_stop_highlight(void)
{
int do_ME = FALSE; // output T_ME code
@@ -3544,7 +3544,7 @@
* - redrawing for a callback and there is a modeless selection
* - there is a popup window
*/
- if (!screen_valid(TRUE)
+ if (!screen_valid(TRUE)
|| line_count <= 0 || line_count > p_ttyscroll
|| end > Rows
#ifdef FEAT_CLIPBOARD
diff --git a/src/sha256.c b/src/sha256.c
index 9c79e0d..6a73a1c 100644
--- a/src/sha256.c
+++ b/src/sha256.c
@@ -40,7 +40,7 @@
(b)[(i) + 3] = (char_u)((n) ); \
}
- void
+ void
sha256_start(context_sha256_T *ctx)
{
ctx->total[0] = 0;
diff --git a/src/strings.c b/src/strings.c
index 16a09f8..c356c36 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -601,14 +601,14 @@
while (len > 0)
{
- i = TOLOWER_ASC(*s1) - TOLOWER_ASC(*s2);
- if (i != 0)
- break; // this character is different
- if (*s1 == NUL)
- break; // strings match until NUL
- ++s1;
- ++s2;
- --len;
+ i = TOLOWER_ASC(*s1) - TOLOWER_ASC(*s2);
+ if (i != 0)
+ break; // this character is different
+ if (*s1 == NUL)
+ break; // strings match until NUL
+ ++s1;
+ ++s2;
+ --len;
}
return i;
}
diff --git a/src/structs.h b/src/structs.h
index caf61ed..1cb70b8 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4579,9 +4579,9 @@
} tagname_T;
typedef struct {
- UINT32_T total[2];
- UINT32_T state[8];
- char_u buffer[64];
+ UINT32_T total[2];
+ UINT32_T state[8];
+ char_u buffer[64];
} context_sha256_T;
/*
diff --git a/src/term.c b/src/term.c
index 5c030ed..03bad0d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -7302,13 +7302,13 @@
return;
while (p->bt_string != NULL)
{
- if (p->bt_entry == (int)KS_ME)
- p->bt_string = &ksme_str[0];
- else if (p->bt_entry == (int)KS_MR)
- p->bt_string = &ksmr_str[0];
- else if (p->bt_entry == (int)KS_MD)
- p->bt_string = &ksmd_str[0];
- ++p;
+ if (p->bt_entry == (int)KS_ME)
+ p->bt_string = &ksme_str[0];
+ else if (p->bt_entry == (int)KS_MR)
+ p->bt_string = &ksmr_str[0];
+ else if (p->bt_entry == (int)KS_MD)
+ p->bt_string = &ksmd_str[0];
+ ++p;
}
}
diff --git a/src/userfunc.c b/src/userfunc.c
index 76cfd44..b9093a0 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -7247,7 +7247,7 @@
char_u *varname;
if (current_funccal == NULL || current_funccal->fc_func->uf_scoped == NULL)
- return NULL;
+ return NULL;
// Search in parent scope, which can be referenced from a lambda.
current_funccal = current_funccal->fc_func->uf_scoped;
diff --git a/src/version.c b/src/version.c
index 9866399..5475e0a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1390,
+/**/
1389,
/**/
1388,
@@ -3815,9 +3817,9 @@
# if defined(USE_GTK3)
msg_puts(_("with GTK3 GUI."));
# elif defined(FEAT_GUI_GNOME)
- msg_puts(_("with GTK2-GNOME GUI."));
+ msg_puts(_("with GTK2-GNOME GUI."));
# else
- msg_puts(_("with GTK2 GUI."));
+ msg_puts(_("with GTK2 GUI."));
# endif
#elif defined(FEAT_GUI_MOTIF)
msg_puts(_("with X11-Motif GUI."));
diff --git a/src/viminfo.c b/src/viminfo.c
index f1e1fc3..5e4caf8 100644
--- a/src/viminfo.c
+++ b/src/viminfo.c
@@ -1606,7 +1606,7 @@
static void
prepare_viminfo_registers(void)
{
- y_read_regs = ALLOC_CLEAR_MULT(yankreg_T, NUM_REGISTERS);
+ y_read_regs = ALLOC_CLEAR_MULT(yankreg_T, NUM_REGISTERS);
}
static void