]> granicus.if.org Git - vim/commitdiff
patch 8.0.1043: warning for uninitialized variable v8.0.1043
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Sep 2017 21:28:54 +0000 (23:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Sep 2017 21:28:54 +0000 (23:28 +0200)
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Move code to check indent inside "if".

src/ops.c
src/version.c

index 9ca5198d2733efcde2c13d86d9dd50079e05cd23..e8308bbcb84dea86aafffe8d40237f270883f4ed 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -2597,14 +2597,6 @@ op_insert(oparg_T *oap, long count1)
            && LT_POS(curbuf->b_op_start_orig, t1))
        oap->start = curbuf->b_op_start_orig;
 
-    /* if indent kicked in, the firstline might have changed
-     * but only do that, if the indent actually increased */
-    ind_post = (colnr_T)getwhitecols_curline();
-    if (curbuf->b_op_start.col > ind_pre && ind_post > ind_pre)
-    {
-       bd.textcol += ind_post - ind_pre;
-       bd.start_vcol += ind_post - ind_pre;
-    }
     /* If user has moved off this line, we don't know what to do, so do
      * nothing.
      * Also don't repeat the insert when Insert mode ended with CTRL-C. */
@@ -2615,6 +2607,15 @@ op_insert(oparg_T *oap, long count1)
     {
        struct block_def        bd2;
 
+       /* If indent kicked in, the firstline might have changed
+        * but only do that, if the indent actually increased. */
+       ind_post = (colnr_T)getwhitecols_curline();
+       if (curbuf->b_op_start.col > ind_pre && ind_post > ind_pre)
+       {
+           bd.textcol += ind_post - ind_pre;
+           bd.start_vcol += ind_post - ind_pre;
+       }
+
        /* The user may have moved the cursor before inserting something, try
         * to adjust the block for that. */
        if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX)
index 77620adc3f7a151bab53f999bfbecd3299087208..2138f0ae9569d6c9961865b025e984e359b17146 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1043,
 /**/
     1042,
 /**/