]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4388: dead code in op_insert() v8.2.4388
authorzeertzjq <zeertzjq@outlook.com>
Tue, 15 Feb 2022 11:48:22 +0000 (11:48 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Feb 2022 11:48:22 +0000 (11:48 +0000)
Problem:    Dead code in op_insert().
Solution:   Remove condition and else block. (closes #9782)

src/ops.c
src/version.c

index 8c463033c153d67c1b07e07cc18508303d246a3d..1c13dac64a729d13f2a0991849182fb2c98f098c 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1586,35 +1586,26 @@ op_insert(oparg_T *oap, long count1)
            int t = getviscol2(curbuf->b_op_start_orig.col,
                                               curbuf->b_op_start_orig.coladd);
 
-           if (!bd.is_MAX)
-           {
-               if (oap->op_type == OP_INSERT
-                       && oap->start.col + oap->start.coladd
-                               != curbuf->b_op_start_orig.col
+           if (oap->op_type == OP_INSERT
+                   && oap->start.col + oap->start.coladd
+                           != curbuf->b_op_start_orig.col
                                              + curbuf->b_op_start_orig.coladd)
-               {
-                   oap->start.col = curbuf->b_op_start_orig.col;
-                   pre_textlen -= t - oap->start_vcol;
-                   oap->start_vcol = t;
-               }
-               else if (oap->op_type == OP_APPEND
-                       && oap->start.col + oap->start.coladd
-                               >= curbuf->b_op_start_orig.col
-                                             + curbuf->b_op_start_orig.coladd)
-               {
-                   oap->start.col = curbuf->b_op_start_orig.col;
-                   // reset pre_textlen to the value of OP_INSERT
-                   pre_textlen += bd.textlen;
-                   pre_textlen -= t - oap->start_vcol;
-                   oap->start_vcol = t;
-                   oap->op_type = OP_INSERT;
-               }
+           {
+               oap->start.col = curbuf->b_op_start_orig.col;
+               pre_textlen -= t - oap->start_vcol;
+               oap->start_vcol = t;
            }
-           else if (bd.is_MAX && oap->op_type == OP_APPEND)
+           else if (oap->op_type == OP_APPEND
+                   && oap->start.col + oap->start.coladd
+                           >= curbuf->b_op_start_orig.col
+                                             + curbuf->b_op_start_orig.coladd)
            {
+               oap->start.col = curbuf->b_op_start_orig.col;
                // reset pre_textlen to the value of OP_INSERT
                pre_textlen += bd.textlen;
                pre_textlen -= t - oap->start_vcol;
+               oap->start_vcol = t;
+               oap->op_type = OP_INSERT;
            }
        }
 
index eca2c748e858e5efe98c3c91128dde4f47e4d1fc..559b6022d8dbc7492547a7d19c12d2e35a7ff637 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4388,
 /**/
     4387,
 /**/