]> granicus.if.org Git - vim/commitdiff
patch 8.2.4610: some conditions are always true v8.2.4610
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Mar 2022 20:42:12 +0000 (20:42 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Mar 2022 20:42:12 +0000 (20:42 +0000)
Problem:    Some conditions are always true.
Solution:   Remove the useless conditions. (closes #9993)

13 files changed:
src/clientserver.c
src/drawline.c
src/drawscreen.c
src/ex_cmds.c
src/fileio.c
src/message.c
src/misc2.c
src/ops.c
src/sign.c
src/spell.c
src/version.c
src/vim9cmds.c
src/window.c

index 15e490fd509fe3c9d390f97fb3cd450540b41e76..bb2108d7d4ebd6dec3143067b49b50ce57135d95 100644 (file)
@@ -420,7 +420,7 @@ cmdsrv_main(
             * For --remote-wait: Wait until the server did edit each
             * 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     j;
index d8b7c4aad19d98e747f5fe58da68880b0b994d66..747a1e33b05febca6b5e51e7e7938f7f5cc08c66 100644 (file)
@@ -1226,8 +1226,7 @@ win_line(
            {
                draw_state = WL_BRI;
                // if need_showbreak is set, breakindent also applies
-               if (wp->w_p_bri && n_extra == 0
-                                        && (row != startrow || need_showbreak)
+               if (wp->w_p_bri && (row != startrow || need_showbreak)
 # ifdef FEAT_DIFF
                        && filler_lines == 0
 # endif
index cdfcac04dc19132a721d8b9dc6bffdf358476747..a562c4d84a221f96da618db1316d5fa2ce1db773 100644 (file)
@@ -1950,9 +1950,8 @@ win_update(win_T *wp)
 
        if (VIsual_active)
        {
-           if (VIsual_active
-                   && (VIsual_mode != wp->w_old_visual_mode
-                       || type == INVERTED_ALL))
+           if (VIsual_mode != wp->w_old_visual_mode
+               || type == INVERTED_ALL)
            {
                // If the type of Visual selection changed, redraw the whole
                // selection.  Also when the ownership of the X selection is
index 13cde84fd8466f393b2b2a1205467ed83ce800ce..be35845356acab647f88dc2474cfbb9fa951c5a2 100644 (file)
@@ -2411,8 +2411,7 @@ getfile(
        if (curbufIsChanged())
 #endif
        {
-           if (other)
-               --no_wait_return;
+           --no_wait_return;
            no_write_message();
            retval = GETFILE_NOT_WRITTEN;       // file has been changed
            goto theend;
index 21417c27feecba4c9518a8585f064504afac5298..9ef2dbd3bc1963de0ef7a93c489e771018da1cb6 100644 (file)
@@ -4933,7 +4933,7 @@ readdir_core(
                break;
            }
 
-           if (!ignore && checkitem != NULL)
+           if (checkitem != NULL)
            {
                int r = checkitem(context, item);
 
index af91bd8130be852c7ca48352dce88d4003886d73..2499723e4d404012fa124996a28c6d958aefaa20 100644 (file)
@@ -1803,7 +1803,7 @@ str2special(
        int len = (*mb_ptr2len)(str);
 
        // 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);
            *sp = str + 1;
index 38da7e59c4c48bd46287e065fc8e0c95a0ba0495..c23c689c00787ce4c197e75f7c72359a6eba410d 100644 (file)
@@ -596,7 +596,7 @@ check_cursor_col_win(win_T *win)
            // Make sure that coladd is not more than the char width.
            // Not for the last character, coladd is then used when the cursor
            // 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;
 
index 1c13dac64a729d13f2a0991849182fb2c98f098c..30e88c7989f313ec6f20060d427ca98155c34cd9 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1310,7 +1310,7 @@ op_tilde(oparg_T *oap)
            changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
                                                                          0L);
 #ifdef FEAT_NETBEANS_INTG
-           if (netbeans_active() && did_change)
+           if (netbeans_active())
            {
                char_u *ptr;
                int count;
index e1aae5121fbb373aa993f8673faac2bbba7daab7..3d9c387d446c6a2e4b7ea1f96f786e54c6758daf 100644 (file)
@@ -847,7 +847,7 @@ sign_mark_adjust(
        if (sign->se_lnum < line1)
            continue;
        new_lnum = sign->se_lnum;
-       if (sign->se_lnum >= line1 && sign->se_lnum <= line2)
+       if (sign->se_lnum <= line2)
        {
            if (amount != MAXLNUM)
                new_lnum += amount;
index 81ba049772dc2282549b964b2cd3306144a3fabf..5145ce198ef0ffc1103a48710c7bf42073a07686 100644 (file)
@@ -1371,11 +1371,10 @@ spell_move_to(
                    // the cursor.
                    if (dir == BACKWARD
                            || lnum != wp->w_cursor.lnum
-                           || (lnum == wp->w_cursor.lnum
-                               && (wrapped
-                                   || (colnr_T)(curline ? p - buf + len
+                           || (wrapped
+                               || (colnr_T)(curline ? p - buf + len
                                                     : p - buf)
-                                                 > wp->w_cursor.col)))
+                                                 > wp->w_cursor.col))
                    {
 #ifdef FEAT_SYN_HL
                        if (has_syntax)
index cd3d9cdeed4f53a496d0d906cdb04409c820c6be..c6425673da78be3870ee9460a70fb0f5e76f351a 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4610,
 /**/
     4609,
 /**/
index cc2c0415837e74e2591773d72f81098f4b11dcb1..072a106a50310502ddc206e30e6b3b42c4bf413d 100644 (file)
@@ -1613,8 +1613,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
        // End :catch or :finally scope: set instruction index in ISN_TRY
        // instruction
        try_isn->isn_arg.tryref.try_ref->try_endtry = instr->ga_len;
-       if (cctx->ctx_skip != SKIP_YES
-                                  && generate_instr(cctx, ISN_ENDTRY) == NULL)
+       if (generate_instr(cctx, ISN_ENDTRY) == NULL)
            return NULL;
 #ifdef FEAT_PROFILE
        if (cctx->ctx_compile_type == CT_PROFILE)
index 435ad037ac171f3ebbb5eb014b5fd1f20a0050f2..5bda6add97e2b72da18a3c1a6c0276b5353c3c4a 100644 (file)
@@ -5691,8 +5691,7 @@ frame_setheight(frame_T *curfrp, int height)
                break;
            if (run == 2 || curfrp->fr_width == Columns)
            {
-               if (height > room + room_cmdline)
-                   height = room + room_cmdline;
+               height = room + room_cmdline;
                break;
            }
            frame_setheight(curfrp->fr_parent, height
@@ -5876,8 +5875,7 @@ frame_setwidth(frame_T *curfrp, int width)
                break;
            if (run == 2 || curfrp->fr_height >= ROWS_AVAIL)
            {
-               if (width > room)
-                   width = room;
+               width = room;
                break;
            }
            frame_setwidth(curfrp->fr_parent, width