Patch 8.2.4388
Problem:    Dead code in op_insert().
Solution:   Remove condition and else block. (closes #9782)
Files:      src/ops.c


*** ../vim-8.2.4387/src/ops.c   2022-02-03 13:05:28.809273683 +0000
--- src/ops.c   2022-02-15 11:45:00.354540430 +0000
***************
*** 1586,1620 ****
            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
!                                             + 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;
!               }
            }
!           else if (bd.is_MAX && oap->op_type == OP_APPEND)
            {
                // reset pre_textlen to the value of OP_INSERT
                pre_textlen += bd.textlen;
                pre_textlen -= t - oap->start_vcol;
            }
        }
  
--- 1586,1611 ----
            int t = getviscol2(curbuf->b_op_start_orig.col,
                                               curbuf->b_op_start_orig.coladd);
  
!           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;
            }
        }
  
*** ../vim-8.2.4387/src/version.c       2022-02-15 11:35:51.148044050 +0000
--- src/version.c       2022-02-15 11:46:03.306367912 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4388,
  /**/

-- 
The future isn't what it used to be.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220215114909.5AF5D1C0DFF%40moolenaar.net.

Raspunde prin e-mail lui