comparison src/edit.c @ 11127:506f5d8b7d8b v8.0.0451

patch 8.0.0451: some macros are in lower case commit https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 12 19:22:36 2017 +0100 patch 8.0.0451: some macros are in lower case Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Mar 2017 19:30:05 +0100
parents 778c10516955
children f4ea50924c6d
comparison
equal deleted inserted replaced
11126:48599a3eae0b 11127:506f5d8b7d8b
855 char_u *str = do_insert_char_pre(c); 855 char_u *str = do_insert_char_pre(c);
856 char_u *p; 856 char_u *p;
857 857
858 if (str != NULL) 858 if (str != NULL)
859 { 859 {
860 for (p = str; *p != NUL; mb_ptr_adv(p)) 860 for (p = str; *p != NUL; MB_PTR_ADV(p))
861 ins_compl_addleader(PTR2CHAR(p)); 861 ins_compl_addleader(PTR2CHAR(p));
862 vim_free(str); 862 vim_free(str);
863 } 863 }
864 else 864 else
865 #endif 865 #endif
1490 if (str != NULL) 1490 if (str != NULL)
1491 { 1491 {
1492 if (*str != NUL && stop_arrow() != FAIL) 1492 if (*str != NUL && stop_arrow() != FAIL)
1493 { 1493 {
1494 /* Insert the new value of v:char literally. */ 1494 /* Insert the new value of v:char literally. */
1495 for (p = str; *p != NUL; mb_ptr_adv(p)) 1495 for (p = str; *p != NUL; MB_PTR_ADV(p))
1496 { 1496 {
1497 c = PTR2CHAR(p); 1497 c = PTR2CHAR(p);
1498 if (c == CAR || c == K_KENTER || c == NL) 1498 if (c == CAR || c == K_KENTER || c == NL)
1499 ins_eol(c); 1499 ins_eol(c);
1500 else 1500 else
2401 { 2401 {
2402 p = str; 2402 p = str;
2403 actual_len = 0; 2403 actual_len = 0;
2404 while (*p != NUL) 2404 while (*p != NUL)
2405 { 2405 {
2406 mb_ptr_adv(p); 2406 MB_PTR_ADV(p);
2407 ++actual_len; 2407 ++actual_len;
2408 } 2408 }
2409 } 2409 }
2410 else 2410 else
2411 #endif 2411 #endif
2417 { 2417 {
2418 p = compl_orig_text; 2418 p = compl_orig_text;
2419 actual_compl_length = 0; 2419 actual_compl_length = 0;
2420 while (*p != NUL) 2420 while (*p != NUL)
2421 { 2421 {
2422 mb_ptr_adv(p); 2422 MB_PTR_ADV(p);
2423 ++actual_compl_length; 2423 ++actual_compl_length;
2424 } 2424 }
2425 } 2425 }
2426 else 2426 else
2427 #endif 2427 #endif
2720 : (c1 != c2)) 2720 : (c1 != c2))
2721 break; 2721 break;
2722 #ifdef FEAT_MBYTE 2722 #ifdef FEAT_MBYTE
2723 if (has_mbyte) 2723 if (has_mbyte)
2724 { 2724 {
2725 mb_ptr_adv(p); 2725 MB_PTR_ADV(p);
2726 mb_ptr_adv(s); 2726 MB_PTR_ADV(s);
2727 } 2727 }
2728 else 2728 else
2729 #endif 2729 #endif
2730 { 2730 {
2731 ++p; 2731 ++p;
3472 char_u *line; 3472 char_u *line;
3473 char_u *p; 3473 char_u *p;
3474 3474
3475 line = ml_get_curline(); 3475 line = ml_get_curline();
3476 p = line + curwin->w_cursor.col; 3476 p = line + curwin->w_cursor.col;
3477 mb_ptr_back(line, p); 3477 MB_PTR_BACK(line, p);
3478 3478
3479 /* Stop completion when the whole word was deleted. For Omni completion 3479 /* Stop completion when the whole word was deleted. For Omni completion
3480 * allow the word to be deleted, we won't match everything. 3480 * allow the word to be deleted, we won't match everything.
3481 * Respect the 'backspace' option. */ 3481 * Respect the 'backspace' option. */
3482 if ((int)(p - line) - (int)compl_col < 0 3482 if ((int)(p - line) - (int)compl_col < 0
4021 ; 4021 ;
4022 #ifdef FEAT_MBYTE 4022 #ifdef FEAT_MBYTE
4023 if (len > 0) 4023 if (len > 0)
4024 len -= (*mb_head_off)(p, p + len); 4024 len -= (*mb_head_off)(p, p + len);
4025 #endif 4025 #endif
4026 for (p += len; *p != NUL; mb_ptr_adv(p)) 4026 for (p += len; *p != NUL; MB_PTR_ADV(p))
4027 AppendCharToRedobuff(K_BS); 4027 AppendCharToRedobuff(K_BS);
4028 } 4028 }
4029 else 4029 else
4030 len = 0; 4030 len = 0;
4031 if (ptr != NULL) 4031 if (ptr != NULL)
5334 /* Go back to just before the first filename character. */ 5334 /* Go back to just before the first filename character. */
5335 if (startcol > 0) 5335 if (startcol > 0)
5336 { 5336 {
5337 char_u *p = line + startcol; 5337 char_u *p = line + startcol;
5338 5338
5339 mb_ptr_back(line, p); 5339 MB_PTR_BACK(line, p);
5340 while (p > line && vim_isfilec(PTR2CHAR(p))) 5340 while (p > line && vim_isfilec(PTR2CHAR(p)))
5341 mb_ptr_back(line, p); 5341 MB_PTR_BACK(line, p);
5342 if (p == line && vim_isfilec(PTR2CHAR(p))) 5342 if (p == line && vim_isfilec(PTR2CHAR(p)))
5343 startcol = 0; 5343 startcol = 0;
5344 else 5344 else
5345 startcol = (int)(p - line) + 1; 5345 startcol = (int)(p - line) + 1;
5346 } 5346 }