0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.4610: some conditions are always true

Problem:    Some conditions are always true.
Solution:   Remove the useless conditions. (closes #9993)
This commit is contained in:
Bram Moolenaar 2022-03-22 20:42:12 +00:00
parent 6f2465d336
commit fe154990c1
13 changed files with 18 additions and 23 deletions

View File

@ -420,7 +420,7 @@ cmdsrv_main(
* For --remote-wait: Wait until the server did edit each * For --remote-wait: Wait until the server did edit each
* file. Also detect that the server no longer runs. * file. Also detect that the server no longer runs.
*/ */
if (ret >= 0 && argtype == ARGTYPE_EDIT_WAIT) if (argtype == ARGTYPE_EDIT_WAIT)
{ {
int numFiles = *argc - i - 1; int numFiles = *argc - i - 1;
int j; int j;

View File

@ -1226,8 +1226,7 @@ win_line(
{ {
draw_state = WL_BRI; draw_state = WL_BRI;
// if need_showbreak is set, breakindent also applies // if need_showbreak is set, breakindent also applies
if (wp->w_p_bri && n_extra == 0 if (wp->w_p_bri && (row != startrow || need_showbreak)
&& (row != startrow || need_showbreak)
# ifdef FEAT_DIFF # ifdef FEAT_DIFF
&& filler_lines == 0 && filler_lines == 0
# endif # endif

View File

@ -1950,9 +1950,8 @@ win_update(win_T *wp)
if (VIsual_active) if (VIsual_active)
{ {
if (VIsual_active if (VIsual_mode != wp->w_old_visual_mode
&& (VIsual_mode != wp->w_old_visual_mode || type == INVERTED_ALL)
|| type == INVERTED_ALL))
{ {
// If the type of Visual selection changed, redraw the whole // If the type of Visual selection changed, redraw the whole
// selection. Also when the ownership of the X selection is // selection. Also when the ownership of the X selection is

View File

@ -2411,8 +2411,7 @@ getfile(
if (curbufIsChanged()) if (curbufIsChanged())
#endif #endif
{ {
if (other) --no_wait_return;
--no_wait_return;
no_write_message(); no_write_message();
retval = GETFILE_NOT_WRITTEN; // file has been changed retval = GETFILE_NOT_WRITTEN; // file has been changed
goto theend; goto theend;

View File

@ -4933,7 +4933,7 @@ readdir_core(
break; break;
} }
if (!ignore && checkitem != NULL) if (checkitem != NULL)
{ {
int r = checkitem(context, item); int r = checkitem(context, item);

View File

@ -1803,7 +1803,7 @@ str2special(
int len = (*mb_ptr2len)(str); int len = (*mb_ptr2len)(str);
// For multi-byte characters check for an illegal byte. // For multi-byte characters check for an illegal byte.
if (has_mbyte && MB_BYTE2LEN(*str) > len) if (MB_BYTE2LEN(*str) > len)
{ {
transchar_nonprint(curbuf, buf, c); transchar_nonprint(curbuf, buf, c);
*sp = str + 1; *sp = str + 1;

View File

@ -596,7 +596,7 @@ check_cursor_col_win(win_T *win)
// Make sure that coladd is not more than the char width. // Make sure that coladd is not more than the char width.
// Not for the last character, coladd is then used when the cursor // Not for the last character, coladd is then used when the cursor
// is actually after the last character. // is actually after the last character.
if (win->w_cursor.col + 1 < len && win->w_cursor.coladd > 0) if (win->w_cursor.col + 1 < len)
{ {
int cs, ce; int cs, ce;

View File

@ -1310,7 +1310,7 @@ op_tilde(oparg_T *oap)
changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
0L); 0L);
#ifdef FEAT_NETBEANS_INTG #ifdef FEAT_NETBEANS_INTG
if (netbeans_active() && did_change) if (netbeans_active())
{ {
char_u *ptr; char_u *ptr;
int count; int count;

View File

@ -847,7 +847,7 @@ sign_mark_adjust(
if (sign->se_lnum < line1) if (sign->se_lnum < line1)
continue; continue;
new_lnum = sign->se_lnum; new_lnum = sign->se_lnum;
if (sign->se_lnum >= line1 && sign->se_lnum <= line2) if (sign->se_lnum <= line2)
{ {
if (amount != MAXLNUM) if (amount != MAXLNUM)
new_lnum += amount; new_lnum += amount;

View File

@ -1371,11 +1371,10 @@ spell_move_to(
// the cursor. // the cursor.
if (dir == BACKWARD if (dir == BACKWARD
|| lnum != wp->w_cursor.lnum || lnum != wp->w_cursor.lnum
|| (lnum == wp->w_cursor.lnum || (wrapped
&& (wrapped || (colnr_T)(curline ? p - buf + len
|| (colnr_T)(curline ? p - buf + len
: p - buf) : p - buf)
> wp->w_cursor.col))) > wp->w_cursor.col))
{ {
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
if (has_syntax) if (has_syntax)

View File

@ -750,6 +750,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 */
/**/
4610,
/**/ /**/
4609, 4609,
/**/ /**/

View File

@ -1613,8 +1613,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
// End :catch or :finally scope: set instruction index in ISN_TRY // End :catch or :finally scope: set instruction index in ISN_TRY
// instruction // instruction
try_isn->isn_arg.tryref.try_ref->try_endtry = instr->ga_len; try_isn->isn_arg.tryref.try_ref->try_endtry = instr->ga_len;
if (cctx->ctx_skip != SKIP_YES if (generate_instr(cctx, ISN_ENDTRY) == NULL)
&& generate_instr(cctx, ISN_ENDTRY) == NULL)
return NULL; return NULL;
#ifdef FEAT_PROFILE #ifdef FEAT_PROFILE
if (cctx->ctx_compile_type == CT_PROFILE) if (cctx->ctx_compile_type == CT_PROFILE)

View File

@ -5691,8 +5691,7 @@ frame_setheight(frame_T *curfrp, int height)
break; break;
if (run == 2 || curfrp->fr_width == Columns) if (run == 2 || curfrp->fr_width == Columns)
{ {
if (height > room + room_cmdline) height = room + room_cmdline;
height = room + room_cmdline;
break; break;
} }
frame_setheight(curfrp->fr_parent, height frame_setheight(curfrp->fr_parent, height
@ -5876,8 +5875,7 @@ frame_setwidth(frame_T *curfrp, int width)
break; break;
if (run == 2 || curfrp->fr_height >= ROWS_AVAIL) if (run == 2 || curfrp->fr_height >= ROWS_AVAIL)
{ {
if (width > room) width = room;
width = room;
break; break;
} }
frame_setwidth(curfrp->fr_parent, width frame_setwidth(curfrp->fr_parent, width