Mercurial > vim
comparison src/ops.c @ 12327:17ed65e87db1 v8.0.1043
patch 8.0.1043: warning for uninitialized variable
commit https://github.com/vim/vim/commit/4ec86ddd77a89766e42bd0a6cfcf10af4c3d03b2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 2 23:28:54 2017 +0200
patch 8.0.1043: warning for uninitialized variable
Problem: Warning for uninitialized variable. (John Marriott)
Solution: Move code to check indent inside "if".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Sep 2017 23:30:04 +0200 |
parents | 4dba3e4f3b01 |
children | 0b10cff73322 |
comparison
equal
deleted
inserted
replaced
12326:fb7fc05de526 | 12327:17ed65e87db1 |
---|---|
2595 * might have actually been reduced, so need to adjust here. */ | 2595 * might have actually been reduced, so need to adjust here. */ |
2596 if (t1.lnum == curbuf->b_op_start_orig.lnum | 2596 if (t1.lnum == curbuf->b_op_start_orig.lnum |
2597 && LT_POS(curbuf->b_op_start_orig, t1)) | 2597 && LT_POS(curbuf->b_op_start_orig, t1)) |
2598 oap->start = curbuf->b_op_start_orig; | 2598 oap->start = curbuf->b_op_start_orig; |
2599 | 2599 |
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 } | |
2608 /* If user has moved off this line, we don't know what to do, so do | 2600 /* If user has moved off this line, we don't know what to do, so do |
2609 * nothing. | 2601 * nothing. |
2610 * Also don't repeat the insert when Insert mode ended with CTRL-C. */ | 2602 * Also don't repeat the insert when Insert mode ended with CTRL-C. */ |
2611 if (curwin->w_cursor.lnum != oap->start.lnum || got_int) | 2603 if (curwin->w_cursor.lnum != oap->start.lnum || got_int) |
2612 return; | 2604 return; |
2613 | 2605 |
2614 if (oap->block_mode) | 2606 if (oap->block_mode) |
2615 { | 2607 { |
2616 struct block_def bd2; | 2608 struct block_def bd2; |
2609 | |
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 } | |
2617 | 2618 |
2618 /* The user may have moved the cursor before inserting something, try | 2619 /* The user may have moved the cursor before inserting something, try |
2619 * to adjust the block for that. */ | 2620 * to adjust the block for that. */ |
2620 if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) | 2621 if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) |
2621 { | 2622 { |