mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:8.0.1043: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Move code to check indent inside "if".
4ec86ddd77
			
			
This commit is contained in:
		| @@ -2014,7 +2014,7 @@ void op_insert(oparg_T *oap, long count1) | |||||||
| { | { | ||||||
|   long ins_len, pre_textlen = 0; |   long ins_len, pre_textlen = 0; | ||||||
|   char_u              *firstline, *ins_text; |   char_u              *firstline, *ins_text; | ||||||
|   colnr_T ind_pre, ind_post; |   colnr_T ind_pre; | ||||||
|   struct block_def bd; |   struct block_def bd; | ||||||
|   int i; |   int i; | ||||||
|   pos_T t1; |   pos_T t1; | ||||||
| @@ -2095,14 +2095,6 @@ void op_insert(oparg_T *oap, long count1) | |||||||
|     oap->start = curbuf->b_op_start_orig; |     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 |   /* If user has moved off this line, we don't know what to do, so do | ||||||
|    * nothing. |    * nothing. | ||||||
|    * Also don't repeat the insert when Insert mode ended with CTRL-C. */ |    * Also don't repeat the insert when Insert mode ended with CTRL-C. */ | ||||||
| @@ -2112,6 +2104,14 @@ void op_insert(oparg_T *oap, long count1) | |||||||
|   if (oap->motion_type == kMTBlockWise) { |   if (oap->motion_type == kMTBlockWise) { | ||||||
|     struct block_def bd2; |     struct block_def bd2; | ||||||
|  |  | ||||||
|  |     // if indent kicked in, the firstline might have changed | ||||||
|  |     // but only do that, if the indent actually increased | ||||||
|  |     const colnr_T 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 |     /* The user may have moved the cursor before inserting something, try | ||||||
|      * to adjust the block for that. */ |      * to adjust the block for that. */ | ||||||
|     if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) { |     if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jan Edmund Lazo
					Jan Edmund Lazo