comparison src/ops.c @ 39:410fa1a31baf v7.0023

updated for version 7.0023
author vimboss
date Sun, 19 Dec 2004 22:46:22 +0000
parents 125e80798a85
children e474bae3795f
comparison
equal deleted inserted replaced
38:c524f99c7925 39:410fa1a31baf
2486 2486
2487 retval = edit(NUL, FALSE, (linenr_T)1); 2487 retval = edit(NUL, FALSE, (linenr_T)1);
2488 2488
2489 #ifdef FEAT_VISUALEXTRA 2489 #ifdef FEAT_VISUALEXTRA
2490 /* 2490 /*
2491 * In Visual block mode, handle copying the next text to all lines of the 2491 * In Visual block mode, handle copying the new text to all lines of the
2492 * block. 2492 * block.
2493 */ 2493 */
2494 if (oap->block_mode && oap->start.lnum != oap->end.lnum) 2494 if (oap->block_mode && oap->start.lnum != oap->end.lnum)
2495 { 2495 {
2496 firstline = ml_get(oap->start.lnum); 2496 firstline = ml_get(oap->start.lnum);
3944 if (insert_space && currsize > 0) 3944 if (insert_space && currsize > 0)
3945 { 3945 {
3946 #ifdef FEAT_MBYTE 3946 #ifdef FEAT_MBYTE
3947 if (has_mbyte) 3947 if (has_mbyte)
3948 { 3948 {
3949 next = curr + currsize - 1; 3949 next = curr + currsize;
3950 next -= (*mb_head_off)(curr, next); 3950 mb_ptr_back(curr, next);
3951 endcurr1 = (*mb_ptr2char)(next); 3951 endcurr1 = (*mb_ptr2char)(next);
3952 if (next > curr) 3952 if (next > curr)
3953 { 3953 {
3954 --next; 3954 mb_ptr_back(curr, next);
3955 next -= (*mb_head_off)(curr, next);
3956 endcurr2 = (*mb_ptr2char)(next); 3955 endcurr2 = (*mb_ptr2char)(next);
3957 } 3956 }
3958 } 3957 }
3959 else 3958 else
3960 #endif 3959 #endif
4612 bdp->pre_whitesp = 0; 4611 bdp->pre_whitesp = 0;
4613 bdp->pre_whitesp_c = 0; 4612 bdp->pre_whitesp_c = 0;
4614 } 4613 }
4615 #endif 4614 #endif
4616 prev_pstart = pstart; 4615 prev_pstart = pstart;
4617 #ifdef FEAT_MBYTE 4616 mb_ptr_adv(pstart);
4618 if (has_mbyte)
4619 pstart += (*mb_ptr2len_check)(pstart);
4620 else
4621 #endif
4622 ++pstart;
4623 } 4617 }
4624 bdp->start_char_vcols = incr; 4618 bdp->start_char_vcols = incr;
4625 if (bdp->start_vcol < oap->start_vcol) /* line too short */ 4619 if (bdp->start_vcol < oap->start_vcol) /* line too short */
4626 { 4620 {
4627 bdp->end_vcol = bdp->start_vcol; 4621 bdp->end_vcol = bdp->start_vcol;
4992 else 4986 else
4993 sprintf((char *)buf2, "%lx", n); 4987 sprintf((char *)buf2, "%lx", n);
4994 length -= (int)STRLEN(buf2); 4988 length -= (int)STRLEN(buf2);
4995 4989
4996 /* 4990 /*
4997 * adjust number of zeros to the new number of digits, so the 4991 * Adjust number of zeros to the new number of digits, so the
4998 * total length of the number remains the same 4992 * total length of the number remains the same.
4993 * Don't do this when
4994 * the result may look like an octal number.
4999 */ 4995 */
5000 if (firstdigit == '0') 4996 if (firstdigit == '0' && !(dooct && hex == 0))
5001 while (length-- > 0) 4997 while (length-- > 0)
5002 *ptr++ = '0'; 4998 *ptr++ = '0';
5003 *ptr = NUL; 4999 *ptr = NUL;
5004 STRCAT(buf1, buf2); 5000 STRCAT(buf1, buf2);
5005 ins_str(buf1); /* insert the new number */ 5001 ins_str(buf1); /* insert the new number */