mirror of
https://github.com/vim/vim
synced 2025-07-15 08:41:54 +00:00
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>
This commit is contained in:
committed by
Christian Brabandt
parent
08db2f4f28
commit
e89aef3f65
@ -4386,10 +4386,10 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -395,9 +395,9 @@ do_showbacktrace(char_u *cmd)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -781,7 +781,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end)
|
||||
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 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus)
|
||||
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])
|
||||
{
|
||||
|
@ -2695,8 +2695,8 @@ request_choice(void)
|
||||
|
||||
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): ");
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ win_id2wp_tp(int id, tabpage_T **tpp)
|
||||
}
|
||||
#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)
|
||||
|
@ -467,36 +467,38 @@ restore_dbg_stuff(struct dbg_stuff *dsp)
|
||||
|
||||
/*
|
||||
* 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 @@ static char ex_error_buf[MSG_BUF_LEN];
|
||||
* 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 @@ ex_stopinsert(exarg_T *eap UNUSED)
|
||||
// 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 @@ get_pressedreturn(void)
|
||||
void
|
||||
set_pressedreturn(int val)
|
||||
{
|
||||
ex_pressedreturn = val;
|
||||
ex_pressedreturn = val;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ empty_pattern_magic(char_u *p, size_t len, magic_T magic_val)
|
||||
// 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)
|
||||
|
@ -162,19 +162,19 @@ typedef struct ff_visited_list_hdr
|
||||
*/
|
||||
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
|
||||
|
@ -2604,7 +2604,7 @@ parse_queued_messages(void)
|
||||
// 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;
|
||||
|
@ -1377,7 +1377,7 @@ gui_motif_update_mousemodel(vimmenu_T *menu)
|
||||
|
||||
// When GUI hasn't started the menus have not been created.
|
||||
if (!gui.in_use)
|
||||
return;
|
||||
return;
|
||||
|
||||
while (menu)
|
||||
{
|
||||
|
@ -272,7 +272,7 @@ im_add_to_input(char_u *str, int len)
|
||||
gui_mch_mousehide(TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
im_preedit_window_set_position(void)
|
||||
{
|
||||
int x, y, width, height;
|
||||
|
@ -505,7 +505,7 @@ draw_shadows(XmEnhancedButtonWidget eb)
|
||||
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 @@ draw_label(XmEnhancedButtonWidget eb, XEvent *event, Region region)
|
||||
|
||||
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 @@ Enter(Widget wid,
|
||||
|
||||
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;
|
||||
|
@ -4172,11 +4172,11 @@ msg_warn_missing_clipboard(void)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ redraw_for_cursorcolumn(win_T *wp)
|
||||
* 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)
|
||||
|
@ -4059,7 +4059,7 @@ nv_gotofile(cmdarg_T *cap)
|
||||
#endif
|
||||
|
||||
if (!check_can_set_curbuf_disabled())
|
||||
return;
|
||||
return;
|
||||
|
||||
ptr = grab_file_name(cap->count1, &lnum);
|
||||
|
||||
|
@ -1864,7 +1864,7 @@ did_set_cryptkey(optset_T *args)
|
||||
}
|
||||
# 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;
|
||||
|
@ -4396,9 +4396,9 @@ mch_calc_cell_size(struct cellsize *cs_out)
|
||||
|
||||
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 @@ mch_expand_wildcards(
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -686,9 +686,9 @@ vms_fixfilename(void *instring)
|
||||
}
|
||||
|
||||
#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
|
||||
|
@ -5089,8 +5089,8 @@ mch_system_piped(char *cmd, int options)
|
||||
// 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);
|
||||
|
@ -4759,7 +4759,7 @@ ex_cbottom(exarg_T *eap)
|
||||
* 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;
|
||||
|
24
src/regexp.c
24
src/regexp.c
@ -410,15 +410,15 @@ static int nextchr; // used for ungetchr()
|
||||
|
||||
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 @@ re_mult_next(char *what)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -1580,7 +1580,7 @@ end_search_hl(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
static void
|
||||
screen_start_highlight(int attr)
|
||||
{
|
||||
attrentry_T *aep = NULL;
|
||||
@ -1738,7 +1738,7 @@ screen_start_highlight(int attr)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
screen_stop_highlight(void)
|
||||
{
|
||||
int do_ME = FALSE; // output T_ME code
|
||||
@ -3544,7 +3544,7 @@ screen_ins_lines(
|
||||
* - 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
|
||||
|
@ -40,7 +40,7 @@
|
||||
(b)[(i) + 3] = (char_u)((n) ); \
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
sha256_start(context_sha256_T *ctx)
|
||||
{
|
||||
ctx->total[0] = 0;
|
||||
|
@ -601,14 +601,14 @@ vim_strnicmp_asc(char *s1, char *s2, size_t len)
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -4579,9 +4579,9 @@ typedef struct
|
||||
} 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;
|
||||
|
||||
/*
|
||||
|
14
src/term.c
14
src/term.c
@ -7302,13 +7302,13 @@ update_tcap(int attr)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7247,7 +7247,7 @@ find_hi_in_scoped_ht(char_u *name, hashtab_T **pht)
|
||||
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;
|
||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1390,
|
||||
/**/
|
||||
1389,
|
||||
/**/
|
||||
@ -3815,9 +3817,9 @@ list_version(void)
|
||||
# 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."));
|
||||
|
@ -1606,7 +1606,7 @@ static yankreg_T *y_read_regs = NULL;
|
||||
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
|
||||
|
Reference in New Issue
Block a user