Mercurial > vim
comparison src/ops.c @ 11121:778c10516955 v8.0.0448
patch 8.0.0448: some macros are in lower case
commit https://github.com/vim/vim/commit/b5aedf3e228d35821591da9ae8501b61cf2e264c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 18:23:53 2017 +0100
patch 8.0.0448: some macros are in lower case
Problem: Some macros are in lower case, which can be confusing.
Solution: Make a few lower case macros upper case.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 18:30:06 +0100 |
parents | f5bd684e47a1 |
children | 506f5d8b7d8b |
comparison
equal
deleted
inserted
replaced
11120:29ee7ffe8df7 | 11121:778c10516955 |
---|---|
2188 --oap->end.col; | 2188 --oap->end.col; |
2189 } | 2189 } |
2190 else if (!oap->inclusive) | 2190 else if (!oap->inclusive) |
2191 dec(&(oap->end)); | 2191 dec(&(oap->end)); |
2192 | 2192 |
2193 while (ltoreq(curwin->w_cursor, oap->end)) | 2193 while (LTOREQ_POS(curwin->w_cursor, oap->end)) |
2194 { | 2194 { |
2195 n = gchar_cursor(); | 2195 n = gchar_cursor(); |
2196 if (n != NUL) | 2196 if (n != NUL) |
2197 { | 2197 { |
2198 #ifdef FEAT_MBYTE | 2198 #ifdef FEAT_MBYTE |
2227 coladvance_force(getviscol()); | 2227 coladvance_force(getviscol()); |
2228 if (curwin->w_cursor.lnum == oap->end.lnum) | 2228 if (curwin->w_cursor.lnum == oap->end.lnum) |
2229 getvpos(&oap->end, end_vcol); | 2229 getvpos(&oap->end, end_vcol); |
2230 } | 2230 } |
2231 #endif | 2231 #endif |
2232 pchar(curwin->w_cursor, c); | 2232 PCHAR(curwin->w_cursor, c); |
2233 } | 2233 } |
2234 } | 2234 } |
2235 #ifdef FEAT_VIRTUALEDIT | 2235 #ifdef FEAT_VIRTUALEDIT |
2236 else if (virtual_op && curwin->w_cursor.lnum == oap->end.lnum) | 2236 else if (virtual_op && curwin->w_cursor.lnum == oap->end.lnum) |
2237 { | 2237 { |
2246 * trample the NUL byte. */ | 2246 * trample the NUL byte. */ |
2247 coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1); | 2247 coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1); |
2248 curwin->w_cursor.col -= (virtcols + 1); | 2248 curwin->w_cursor.col -= (virtcols + 1); |
2249 for (; virtcols >= 0; virtcols--) | 2249 for (; virtcols >= 0; virtcols--) |
2250 { | 2250 { |
2251 pchar(curwin->w_cursor, c); | 2251 PCHAR(curwin->w_cursor, c); |
2252 if (inc(&curwin->w_cursor) == -1) | 2252 if (inc(&curwin->w_cursor) == -1) |
2253 break; | 2253 break; |
2254 } | 2254 } |
2255 } | 2255 } |
2256 #endif | 2256 #endif |
2336 for (;;) | 2336 for (;;) |
2337 { | 2337 { |
2338 did_change |= swapchars(oap->op_type, &pos, | 2338 did_change |= swapchars(oap->op_type, &pos, |
2339 pos.lnum == oap->end.lnum ? oap->end.col + 1: | 2339 pos.lnum == oap->end.lnum ? oap->end.col + 1: |
2340 (int)STRLEN(ml_get_pos(&pos))); | 2340 (int)STRLEN(ml_get_pos(&pos))); |
2341 if (ltoreq(oap->end, pos) || inc(&pos) == -1) | 2341 if (LTOREQ_POS(oap->end, pos) || inc(&pos) == -1) |
2342 break; | 2342 break; |
2343 } | 2343 } |
2344 if (did_change) | 2344 if (did_change) |
2345 { | 2345 { |
2346 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, | 2346 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, |
2488 ins_char(nc); | 2488 ins_char(nc); |
2489 curwin->w_cursor = sp; | 2489 curwin->w_cursor = sp; |
2490 } | 2490 } |
2491 else | 2491 else |
2492 #endif | 2492 #endif |
2493 pchar(*pos, nc); | 2493 PCHAR(*pos, nc); |
2494 return TRUE; | 2494 return TRUE; |
2495 } | 2495 } |
2496 return FALSE; | 2496 return FALSE; |
2497 } | 2497 } |
2498 | 2498 |
2573 { | 2573 { |
2574 curwin->w_cursor = oap->end; | 2574 curwin->w_cursor = oap->end; |
2575 check_cursor_col(); | 2575 check_cursor_col(); |
2576 | 2576 |
2577 /* Works just like an 'i'nsert on the next character. */ | 2577 /* Works just like an 'i'nsert on the next character. */ |
2578 if (!lineempty(curwin->w_cursor.lnum) | 2578 if (!LINEEMPTY(curwin->w_cursor.lnum) |
2579 && oap->start_vcol != oap->end_vcol) | 2579 && oap->start_vcol != oap->end_vcol) |
2580 inc_cursor(); | 2580 inc_cursor(); |
2581 } | 2581 } |
2582 } | 2582 } |
2583 | 2583 |
2586 | 2586 |
2587 /* When a tab was inserted, and the characters in front of the tab | 2587 /* When a tab was inserted, and the characters in front of the tab |
2588 * have been converted to a tab as well, the column of the cursor | 2588 * have been converted to a tab as well, the column of the cursor |
2589 * might have actually been reduced, so need to adjust here. */ | 2589 * might have actually been reduced, so need to adjust here. */ |
2590 if (t1.lnum == curbuf->b_op_start_orig.lnum | 2590 if (t1.lnum == curbuf->b_op_start_orig.lnum |
2591 && lt(curbuf->b_op_start_orig, t1)) | 2591 && LT_POS(curbuf->b_op_start_orig, t1)) |
2592 oap->start = curbuf->b_op_start_orig; | 2592 oap->start = curbuf->b_op_start_orig; |
2593 | 2593 |
2594 /* If user has moved off this line, we don't know what to do, so do | 2594 /* If user has moved off this line, we don't know what to do, so do |
2595 * nothing. | 2595 * nothing. |
2596 * Also don't repeat the insert when Insert mode ended with CTRL-C. */ | 2596 * Also don't repeat the insert when Insert mode ended with CTRL-C. */ |
2733 return FALSE; | 2733 return FALSE; |
2734 } | 2734 } |
2735 else if (op_delete(oap) == FAIL) | 2735 else if (op_delete(oap) == FAIL) |
2736 return FALSE; | 2736 return FALSE; |
2737 | 2737 |
2738 if ((l > curwin->w_cursor.col) && !lineempty(curwin->w_cursor.lnum) | 2738 if ((l > curwin->w_cursor.col) && !LINEEMPTY(curwin->w_cursor.lnum) |
2739 && !virtual_op) | 2739 && !virtual_op) |
2740 inc_cursor(); | 2740 inc_cursor(); |
2741 | 2741 |
2742 #ifdef FEAT_VISUALEXTRA | 2742 #ifdef FEAT_VISUALEXTRA |
2743 /* check for still on same line (<CR> in inserted text meaningless) */ | 2743 /* check for still on same line (<CR> in inserted text meaningless) */ |
3517 #endif | 3517 #endif |
3518 if (dir == FORWARD) | 3518 if (dir == FORWARD) |
3519 ++lnum; | 3519 ++lnum; |
3520 /* In an empty buffer the empty line is going to be replaced, include | 3520 /* In an empty buffer the empty line is going to be replaced, include |
3521 * it in the saved lines. */ | 3521 * it in the saved lines. */ |
3522 if ((bufempty() ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) | 3522 if ((BUFEMPTY() ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) |
3523 goto end; | 3523 goto end; |
3524 #ifdef FEAT_FOLDING | 3524 #ifdef FEAT_FOLDING |
3525 if (dir == FORWARD) | 3525 if (dir == FORWARD) |
3526 curwin->w_cursor.lnum = lnum - 1; | 3526 curwin->w_cursor.lnum = lnum - 1; |
3527 else | 3527 else |
4934 if (first_par_line | 4934 if (first_par_line |
4935 && (do_second_indent || do_number_indent) | 4935 && (do_second_indent || do_number_indent) |
4936 && prev_is_end_par | 4936 && prev_is_end_par |
4937 && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) | 4937 && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) |
4938 { | 4938 { |
4939 if (do_second_indent && !lineempty(curwin->w_cursor.lnum + 1)) | 4939 if (do_second_indent && !LINEEMPTY(curwin->w_cursor.lnum + 1)) |
4940 { | 4940 { |
4941 #ifdef FEAT_COMMENTS | 4941 #ifdef FEAT_COMMENTS |
4942 if (leader_len == 0 && next_leader_len == 0) | 4942 if (leader_len == 0 && next_leader_len == 0) |
4943 { | 4943 { |
4944 /* no comment found */ | 4944 /* no comment found */ |
7235 else | 7235 else |
7236 eol_size = 1; | 7236 eol_size = 1; |
7237 | 7237 |
7238 if (VIsual_active) | 7238 if (VIsual_active) |
7239 { | 7239 { |
7240 if (lt(VIsual, curwin->w_cursor)) | 7240 if (LT_POS(VIsual, curwin->w_cursor)) |
7241 { | 7241 { |
7242 min_pos = VIsual; | 7242 min_pos = VIsual; |
7243 max_pos = curwin->w_cursor; | 7243 max_pos = curwin->w_cursor; |
7244 } | 7244 } |
7245 else | 7245 else |