forked from aniani/vim
patch 9.0.0124: code has more indent than needed
Problem: Code has more indent than needed. Solution: Use continue and return statements. (closes #10824)
This commit is contained in:
parent
c146d974f1
commit
101d57b34b
@ -1241,8 +1241,8 @@ arg_all(void)
|
|||||||
for (idx = 0; idx < ARGCOUNT; ++idx)
|
for (idx = 0; idx < ARGCOUNT; ++idx)
|
||||||
{
|
{
|
||||||
p = alist_name(&ARGLIST[idx]);
|
p = alist_name(&ARGLIST[idx]);
|
||||||
if (p != NULL)
|
if (p == NULL)
|
||||||
{
|
continue;
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
// insert a space in between names
|
// insert a space in between names
|
||||||
@ -1268,7 +1268,6 @@ arg_all(void)
|
|||||||
++len;
|
++len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// second time: break here
|
// second time: break here
|
||||||
if (retval != NULL)
|
if (retval != NULL)
|
||||||
|
10
src/diff.c
10
src/diff.c
@ -678,9 +678,11 @@ diff_redraw(
|
|||||||
|
|
||||||
need_diff_redraw = FALSE;
|
need_diff_redraw = FALSE;
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp)
|
||||||
// when closing windows or wiping buffers skip invalid window
|
|
||||||
if (wp->w_p_diff && buf_valid(wp->w_buffer))
|
|
||||||
{
|
{
|
||||||
|
// when closing windows or wiping buffers skip invalid window
|
||||||
|
if (!wp->w_p_diff || !buf_valid(wp->w_buffer))
|
||||||
|
continue;
|
||||||
|
|
||||||
redraw_win_later(wp, SOME_VALID);
|
redraw_win_later(wp, SOME_VALID);
|
||||||
if (wp != curwin)
|
if (wp != curwin)
|
||||||
wp_other = wp;
|
wp_other = wp;
|
||||||
@ -688,8 +690,8 @@ diff_redraw(
|
|||||||
if (dofold && foldmethodIsDiff(wp))
|
if (dofold && foldmethodIsDiff(wp))
|
||||||
foldUpdateAll(wp);
|
foldUpdateAll(wp);
|
||||||
#endif
|
#endif
|
||||||
// A change may have made filler lines invalid, need to take care
|
// A change may have made filler lines invalid, need to take care of
|
||||||
// of that for other windows.
|
// that for other windows.
|
||||||
n = diff_check(wp, wp->w_topline);
|
n = diff_check(wp, wp->w_topline);
|
||||||
if ((wp != curwin && wp->w_topfill > 0) || n > 0)
|
if ((wp != curwin && wp->w_topfill > 0) || n > 0)
|
||||||
{
|
{
|
||||||
|
@ -3749,7 +3749,8 @@ ins_ctrl_(void)
|
|||||||
static int
|
static int
|
||||||
ins_start_select(int c)
|
ins_start_select(int c)
|
||||||
{
|
{
|
||||||
if (km_startsel)
|
if (!km_startsel)
|
||||||
|
return FALSE;
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case K_KHOME:
|
case K_KHOME:
|
||||||
@ -3775,8 +3776,8 @@ ins_start_select(int c)
|
|||||||
case K_S_DOWN:
|
case K_S_DOWN:
|
||||||
case K_S_END:
|
case K_S_END:
|
||||||
case K_S_HOME:
|
case K_S_HOME:
|
||||||
// Start selection right away, the cursor can move with
|
// Start selection right away, the cursor can move with CTRL-O when
|
||||||
// CTRL-O when beyond the end of the line.
|
// beyond the end of the line.
|
||||||
start_selection();
|
start_selection();
|
||||||
|
|
||||||
// Execute the key in (insert) Select mode.
|
// Execute the key in (insert) Select mode.
|
||||||
|
@ -1220,8 +1220,9 @@ do_helptags(char_u *dirname, int add_help_tags, int ignore_writeerr)
|
|||||||
for (i = 0; i < filecount; ++i)
|
for (i = 0; i < filecount; ++i)
|
||||||
{
|
{
|
||||||
len = (int)STRLEN(files[i]);
|
len = (int)STRLEN(files[i]);
|
||||||
if (len > 4)
|
if (len <= 4)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
if (STRICMP(files[i] + len - 4, ".txt") == 0)
|
if (STRICMP(files[i] + len - 4, ".txt") == 0)
|
||||||
{
|
{
|
||||||
// ".txt" -> language "en"
|
// ".txt" -> language "en"
|
||||||
@ -1253,7 +1254,6 @@ do_helptags(char_u *dirname, int add_help_tags, int ignore_writeerr)
|
|||||||
((char_u *)ga.ga_data)[ga.ga_len++] = lang[1];
|
((char_u *)ga.ga_data)[ga.ga_len++] = lang[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Loop over the found languages to generate a tags file for each one.
|
// Loop over the found languages to generate a tags file for each one.
|
||||||
for (j = 0; j < ga.ga_len; j += 2)
|
for (j = 0; j < ga.ga_len; j += 2)
|
||||||
|
@ -1917,8 +1917,9 @@ check_scrollbind(linenr_T topline_diff, long leftcol_diff)
|
|||||||
{
|
{
|
||||||
curbuf = curwin->w_buffer;
|
curbuf = curwin->w_buffer;
|
||||||
// skip original window and windows with 'noscrollbind'
|
// skip original window and windows with 'noscrollbind'
|
||||||
if (curwin != old_curwin && curwin->w_p_scb)
|
if (curwin == old_curwin || !curwin->w_p_scb)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
// do the vertical scroll
|
// do the vertical scroll
|
||||||
if (want_ver)
|
if (want_ver)
|
||||||
{
|
{
|
||||||
@ -1956,7 +1957,6 @@ check_scrollbind(linenr_T topline_diff, long leftcol_diff)
|
|||||||
leftcol_changed();
|
leftcol_changed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// reset current-window
|
// reset current-window
|
||||||
VIsual_select = old_VIsual_select;
|
VIsual_select = old_VIsual_select;
|
||||||
|
40
src/syntax.c
40
src/syntax.c
@ -1485,9 +1485,10 @@ syn_stack_equal(synstate_T *sp)
|
|||||||
reg_extmatch_T *six, *bsx;
|
reg_extmatch_T *six, *bsx;
|
||||||
|
|
||||||
// First a quick check if the stacks have the same size end nextlist.
|
// First a quick check if the stacks have the same size end nextlist.
|
||||||
if (sp->sst_stacksize == current_state.ga_len
|
if (sp->sst_stacksize != current_state.ga_len
|
||||||
&& sp->sst_next_list == current_next_list)
|
|| sp->sst_next_list != current_next_list)
|
||||||
{
|
return FALSE;
|
||||||
|
|
||||||
// Need to compare all states on both stacks.
|
// Need to compare all states on both stacks.
|
||||||
if (sp->sst_stacksize > SST_FIX_STATES)
|
if (sp->sst_stacksize > SST_FIX_STATES)
|
||||||
bp = SYN_STATE_P(&(sp->sst_union.sst_ga));
|
bp = SYN_STATE_P(&(sp->sst_union.sst_ga));
|
||||||
@ -1499,32 +1500,27 @@ syn_stack_equal(synstate_T *sp)
|
|||||||
// If the item has another index the state is different.
|
// If the item has another index the state is different.
|
||||||
if (bp[i].bs_idx != CUR_STATE(i).si_idx)
|
if (bp[i].bs_idx != CUR_STATE(i).si_idx)
|
||||||
break;
|
break;
|
||||||
if (bp[i].bs_extmatch != CUR_STATE(i).si_extmatch)
|
if (bp[i].bs_extmatch == CUR_STATE(i).si_extmatch)
|
||||||
{
|
continue;
|
||||||
// When the extmatch pointers are different, the strings in
|
// When the extmatch pointers are different, the strings in them can
|
||||||
// them can still be the same. Check if the extmatch
|
// still be the same. Check if the extmatch references are equal.
|
||||||
// references are equal.
|
|
||||||
bsx = bp[i].bs_extmatch;
|
bsx = bp[i].bs_extmatch;
|
||||||
six = CUR_STATE(i).si_extmatch;
|
six = CUR_STATE(i).si_extmatch;
|
||||||
// If one of the extmatch pointers is NULL the states are
|
// If one of the extmatch pointers is NULL the states are different.
|
||||||
// different.
|
|
||||||
if (bsx == NULL || six == NULL)
|
if (bsx == NULL || six == NULL)
|
||||||
break;
|
break;
|
||||||
for (j = 0; j < NSUBEXP; ++j)
|
for (j = 0; j < NSUBEXP; ++j)
|
||||||
{
|
{
|
||||||
// Check each referenced match string. They must all be
|
// Check each referenced match string. They must all be equal.
|
||||||
// equal.
|
|
||||||
if (bsx->matches[j] != six->matches[j])
|
if (bsx->matches[j] != six->matches[j])
|
||||||
{
|
{
|
||||||
// If the pointer is different it can still be the
|
// If the pointer is different it can still be the same text.
|
||||||
// same text. Compare the strings, ignore case when
|
// Compare the strings, ignore case when the start item has the
|
||||||
// the start item has the sp_ic flag set.
|
// sp_ic flag set.
|
||||||
if (bsx->matches[j] == NULL
|
if (bsx->matches[j] == NULL || six->matches[j] == NULL)
|
||||||
|| six->matches[j] == NULL)
|
|
||||||
break;
|
break;
|
||||||
if ((SYN_ITEMS(syn_block)[CUR_STATE(i).si_idx]).sp_ic
|
if ((SYN_ITEMS(syn_block)[CUR_STATE(i).si_idx]).sp_ic
|
||||||
? MB_STRICMP(bsx->matches[j],
|
? MB_STRICMP(bsx->matches[j], six->matches[j]) != 0
|
||||||
six->matches[j]) != 0
|
|
||||||
: STRCMP(bsx->matches[j], six->matches[j]) != 0)
|
: STRCMP(bsx->matches[j], six->matches[j]) != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1532,11 +1528,7 @@ syn_stack_equal(synstate_T *sp)
|
|||||||
if (j != NSUBEXP)
|
if (j != NSUBEXP)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
return i < 0 ? TRUE : FALSE;
|
||||||
if (i < 0)
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -735,6 +735,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
124,
|
||||||
/**/
|
/**/
|
||||||
123,
|
123,
|
||||||
/**/
|
/**/
|
||||||
|
22
src/window.c
22
src/window.c
@ -2004,11 +2004,10 @@ win_equal_rec(
|
|||||||
next_curwin_size = -1;
|
next_curwin_size = -1;
|
||||||
FOR_ALL_FRAMES(fr, topfr->fr_child)
|
FOR_ALL_FRAMES(fr, topfr->fr_child)
|
||||||
{
|
{
|
||||||
// If 'winfixwidth' set keep the window width if
|
if (!frame_fixed_width(fr))
|
||||||
// possible.
|
continue;
|
||||||
|
// If 'winfixwidth' set keep the window width if possible.
|
||||||
// Watch out for this window being the next_curwin.
|
// Watch out for this window being the next_curwin.
|
||||||
if (frame_fixed_width(fr))
|
|
||||||
{
|
|
||||||
n = frame_minwidth(fr, NOWIN);
|
n = frame_minwidth(fr, NOWIN);
|
||||||
new_size = fr->fr_width;
|
new_size = fr->fr_width;
|
||||||
if (frame_has_win(fr, next_curwin))
|
if (frame_has_win(fr, next_curwin))
|
||||||
@ -2030,7 +2029,6 @@ win_equal_rec(
|
|||||||
}
|
}
|
||||||
fr->fr_newwidth = new_size;
|
fr->fr_newwidth = new_size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (next_curwin_size == -1)
|
if (next_curwin_size == -1)
|
||||||
{
|
{
|
||||||
if (!has_next_curwin)
|
if (!has_next_curwin)
|
||||||
@ -2145,11 +2143,11 @@ win_equal_rec(
|
|||||||
next_curwin_size = -1;
|
next_curwin_size = -1;
|
||||||
FOR_ALL_FRAMES(fr, topfr->fr_child)
|
FOR_ALL_FRAMES(fr, topfr->fr_child)
|
||||||
{
|
{
|
||||||
|
if (!frame_fixed_height(fr))
|
||||||
|
continue;
|
||||||
// If 'winfixheight' set keep the window height if
|
// If 'winfixheight' set keep the window height if
|
||||||
// possible.
|
// possible.
|
||||||
// Watch out for this window being the next_curwin.
|
// Watch out for this window being the next_curwin.
|
||||||
if (frame_fixed_height(fr))
|
|
||||||
{
|
|
||||||
n = frame_minheight(fr, NOWIN);
|
n = frame_minheight(fr, NOWIN);
|
||||||
new_size = fr->fr_height;
|
new_size = fr->fr_height;
|
||||||
if (frame_has_win(fr, next_curwin))
|
if (frame_has_win(fr, next_curwin))
|
||||||
@ -2171,7 +2169,6 @@ win_equal_rec(
|
|||||||
}
|
}
|
||||||
fr->fr_newheight = new_size;
|
fr->fr_newheight = new_size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (next_curwin_size == -1)
|
if (next_curwin_size == -1)
|
||||||
{
|
{
|
||||||
if (!has_next_curwin)
|
if (!has_next_curwin)
|
||||||
@ -3752,8 +3749,8 @@ close_others(
|
|||||||
for (wp = firstwin; win_valid(wp); wp = nextwp)
|
for (wp = firstwin; win_valid(wp); wp = nextwp)
|
||||||
{
|
{
|
||||||
nextwp = wp->w_next;
|
nextwp = wp->w_next;
|
||||||
if (wp != curwin) // don't close current window
|
if (wp == curwin) // don't close current window
|
||||||
{
|
continue;
|
||||||
|
|
||||||
// Check if it's allowed to abandon this window
|
// Check if it's allowed to abandon this window
|
||||||
r = can_abandon(wp->w_buffer, forceit);
|
r = can_abandon(wp->w_buffer, forceit);
|
||||||
@ -3779,9 +3776,7 @@ close_others(
|
|||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
win_close(wp, !buf_hide(wp->w_buffer)
|
win_close(wp, !buf_hide(wp->w_buffer) && !bufIsChanged(wp->w_buffer));
|
||||||
&& !bufIsChanged(wp->w_buffer));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message && !ONE_WINDOW)
|
if (message && !ONE_WINDOW)
|
||||||
@ -5708,6 +5703,7 @@ frame_setheight(frame_T *curfrp, int height)
|
|||||||
|
|
||||||
if (curfrp->fr_parent == NULL)
|
if (curfrp->fr_parent == NULL)
|
||||||
{
|
{
|
||||||
|
// topframe: can only change the command line
|
||||||
if (height > ROWS_AVAIL)
|
if (height > ROWS_AVAIL)
|
||||||
// If height is greater than the available space, try to create
|
// If height is greater than the available space, try to create
|
||||||
// space for the frame by reducing 'cmdheight' if possible, while
|
// space for the frame by reducing 'cmdheight' if possible, while
|
||||||
|
Loading…
x
Reference in New Issue
Block a user