Skip to content

Commit 4ec86dd

Browse files
committed
patch 8.0.1043: warning for uninitialized variable
Problem: Warning for uninitialized variable. (John Marriott) Solution: Move code to check indent inside "if".
1 parent 9f45ccd commit 4ec86dd

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/ops.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,14 +2597,6 @@ op_insert(oparg_T *oap, long count1)
25972597
&& LT_POS(curbuf->b_op_start_orig, t1))
25982598
oap->start = curbuf->b_op_start_orig;
25992599

2600-
/* if indent kicked in, the firstline might have changed
2601-
* but only do that, if the indent actually increased */
2602-
ind_post = (colnr_T)getwhitecols_curline();
2603-
if (curbuf->b_op_start.col > ind_pre && ind_post > ind_pre)
2604-
{
2605-
bd.textcol += ind_post - ind_pre;
2606-
bd.start_vcol += ind_post - ind_pre;
2607-
}
26082600
/* If user has moved off this line, we don't know what to do, so do
26092601
* nothing.
26102602
* Also don't repeat the insert when Insert mode ended with CTRL-C. */
@@ -2615,6 +2607,15 @@ op_insert(oparg_T *oap, long count1)
26152607
{
26162608
struct block_def bd2;
26172609

2610+
/* If indent kicked in, the firstline might have changed
2611+
* but only do that, if the indent actually increased. */
2612+
ind_post = (colnr_T)getwhitecols_curline();
2613+
if (curbuf->b_op_start.col > ind_pre && ind_post > ind_pre)
2614+
{
2615+
bd.textcol += ind_post - ind_pre;
2616+
bd.start_vcol += ind_post - ind_pre;
2617+
}
2618+
26182619
/* The user may have moved the cursor before inserting something, try
26192620
* to adjust the block for that. */
26202621
if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1043,
772774
/**/
773775
1042,
774776
/**/

0 commit comments

Comments
 (0)