Skip to content

Commit b5aedf3

Browse files
committed
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.
1 parent 8774845 commit b5aedf3

30 files changed

+194
-166
lines changed

src/buffer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ read_buffer(
111111
{
112112
/* Set or reset 'modified' before executing autocommands, so that
113113
* it can be changed there. */
114-
if (!readonlymode && !bufempty())
114+
if (!readonlymode && !BUFEMPTY())
115115
changed();
116116
else if (retval == OK)
117117
unchanged(curbuf, FALSE);
@@ -1959,7 +1959,7 @@ buflist_new(
19591959
&& curbuf != NULL
19601960
&& curbuf->b_ffname == NULL
19611961
&& curbuf->b_nwindows <= 1
1962-
&& (curbuf->b_ml.ml_mfp == NULL || bufempty()))
1962+
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY()))
19631963
{
19641964
buf = curbuf;
19651965
#ifdef FEAT_AUTOCMD
@@ -2334,7 +2334,7 @@ buflist_getfile(
23342334
/* If 'switchbuf' contains "split", "vsplit" or "newtab" and the
23352335
* current buffer isn't empty: open new tab or window */
23362336
if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB))
2337-
&& !bufempty())
2337+
&& !BUFEMPTY())
23382338
{
23392339
if (swb_flags & SWB_NEWTAB)
23402340
tabpage_new();
@@ -5017,7 +5017,7 @@ do_arg_all(
50175017
#ifdef FEAT_WINDOWS
50185018
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
50195019
* leaving an empty tab page when executed locally. */
5020-
if (keep_tabs && bufempty() && curbuf->b_nwindows == 1
5020+
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
50215021
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
50225022
use_firstwin = TRUE;
50235023
#endif

src/charset.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,8 @@ getvcol(
14031403
&& (State & NORMAL)
14041404
&& !wp->w_p_list
14051405
&& !virtual_active()
1406-
&& !(VIsual_active && (*p_sel == 'e' || ltoreq(*pos, VIsual)))
1406+
&& !(VIsual_active
1407+
&& (*p_sel == 'e' || LTOREQ_POS(*pos, VIsual)))
14071408
)
14081409
*cursor = vcol + incr - 1; /* cursor at end */
14091410
else
@@ -1496,7 +1497,7 @@ getvcols(
14961497
{
14971498
colnr_T from1, from2, to1, to2;
14981499

1499-
if (ltp(pos1, pos2))
1500+
if (LT_POSP(pos1, pos2))
15001501
{
15011502
getvvcol(wp, pos1, &from1, NULL, &to1);
15021503
getvvcol(wp, pos2, &from2, NULL, &to2);

src/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@ ex_diffgetput(exarg_T *eap)
23332333
end_skip = 0;
23342334
}
23352335

2336-
buf_empty = bufempty();
2336+
buf_empty = BUFEMPTY();
23372337
added = 0;
23382338
for (i = 0; i < count; ++i)
23392339
{

src/edit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ edit(
408408
* the "A" command, thus set State to avoid that. Also check that the
409409
* line number is still valid (lines may have been deleted).
410410
* Do not restore if v:char was set to a non-empty string. */
411-
if (!equalpos(curwin->w_cursor, save_cursor)
411+
if (!EQUAL_POS(curwin->w_cursor, save_cursor)
412412
# ifdef FEAT_EVAL
413413
&& *get_vim_var_str(VV_CHAR) == NUL
414414
# endif
@@ -1631,7 +1631,7 @@ ins_redraw(
16311631
# endif
16321632
)
16331633
# ifdef FEAT_AUTOCMD
1634-
&& !equalpos(last_cursormoved, curwin->w_cursor)
1634+
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor)
16351635
# endif
16361636
# ifdef FEAT_INS_EXPAND
16371637
&& !pum_visible()
@@ -4130,7 +4130,7 @@ expand_by_function(
41304130
}
41314131
curwin->w_cursor = pos; /* restore the cursor position */
41324132
validate_cursor();
4133-
if (!equalpos(curwin->w_cursor, pos))
4133+
if (!EQUAL_POS(curwin->w_cursor, pos))
41344134
{
41354135
EMSG(_(e_compldel));
41364136
goto theend;
@@ -5408,7 +5408,7 @@ ins_complete(int c, int enable_pum)
54085408
}
54095409
curwin->w_cursor = pos; /* restore the cursor position */
54105410
validate_cursor();
5411-
if (!equalpos(curwin->w_cursor, pos))
5411+
if (!EQUAL_POS(curwin->w_cursor, pos))
54125412
{
54135413
EMSG(_(e_compldel));
54145414
return FAIL;
@@ -8947,7 +8947,7 @@ ins_bs(
89478947
* can't backup past starting point unless 'backspace' > 1
89488948
* can backup to a previous line if 'backspace' == 0
89498949
*/
8950-
if ( bufempty()
8950+
if ( BUFEMPTY()
89518951
|| (
89528952
#ifdef FEAT_RIGHTLEFT
89538953
!revins_on &&
@@ -9462,7 +9462,7 @@ ins_mousescroll(int dir)
94629462
}
94639463
# endif
94649464

9465-
if (!equalpos(curwin->w_cursor, tpos))
9465+
if (!EQUAL_POS(curwin->w_cursor, tpos))
94669466
{
94679467
start_arrow(&tpos);
94689468
# ifdef FEAT_CINDENT

src/evalfunc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9552,20 +9552,20 @@ do_searchpair(
95529552

95539553
save_cursor = curwin->w_cursor;
95549554
pos = curwin->w_cursor;
9555-
clearpos(&firstpos);
9556-
clearpos(&foundpos);
9555+
CLEAR_POS(&firstpos);
9556+
CLEAR_POS(&foundpos);
95579557
pat = pat3;
95589558
for (;;)
95599559
{
95609560
n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
95619561
options, RE_SEARCH, lnum_stop, &tm);
9562-
if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
9562+
if (n == FAIL || (firstpos.lnum != 0 && EQUAL_POS(pos, firstpos)))
95639563
/* didn't find it or found the first match again: FAIL */
95649564
break;
95659565

95669566
if (firstpos.lnum == 0)
95679567
firstpos = pos;
9568-
if (equalpos(pos, foundpos))
9568+
if (EQUAL_POS(pos, foundpos))
95699569
{
95709570
/* Found the same position again. Can happen with a pattern that
95719571
* has "\zs" at the end and searching backwards. Advance one

src/ex_cmds.c

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -851,24 +851,41 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
851851
* their final destination at the new text position -- webb
852852
*/
853853
last_line = curbuf->b_ml.ml_line_count;
854-
mark_adjust(line1, line2, last_line - line2, 0L);
855-
changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines);
854+
mark_adjust_nofold(line1, line2, last_line - line2, 0L);
856855
if (dest >= line2)
857856
{
858-
mark_adjust(line2 + 1, dest, -num_lines, 0L);
857+
mark_adjust_nofold(line2 + 1, dest, -num_lines, 0L);
858+
#ifdef FEAT_FOLDING
859+
win_T *win;
860+
tabpage_T *tp;
861+
862+
FOR_ALL_TAB_WINDOWS(tp, win) {
863+
if (win->w_buffer == curbuf)
864+
foldSwapRange(&win->w_folds, line1, line2, dest + 1,
865+
dest + num_lines);
866+
}
867+
#endif
859868
curbuf->b_op_start.lnum = dest - num_lines + 1;
860869
curbuf->b_op_end.lnum = dest;
861870
}
862871
else
863872
{
864-
mark_adjust(dest + 1, line1 - 1, num_lines, 0L);
873+
mark_adjust_nofold(dest + 1, line1 - 1, num_lines, 0L);
874+
#ifdef FEAT_FOLDING
875+
win_T *win;
876+
tabpage_T *tp;
877+
878+
FOR_ALL_TAB_WINDOWS(tp, win) {
879+
if (win->w_buffer == curbuf)
880+
foldSwapRange(&win->w_folds, dest + 1, line1 - 1, line1, line2);
881+
}
882+
#endif
865883
curbuf->b_op_start.lnum = dest + 1;
866884
curbuf->b_op_end.lnum = dest + num_lines;
867885
}
868886
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
869-
mark_adjust(last_line - num_lines + 1, last_line,
887+
mark_adjust_nofold(last_line - num_lines + 1, last_line,
870888
-(last_line - dest - extra), 0L);
871-
changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra);
872889

873890
/*
874891
* Now we delete the original text -- webb
@@ -4211,7 +4228,7 @@ do_ecmd(
42114228

42124229
/* If autocommands change the cursor position or topline, we should
42134230
* keep it. Also when it moves within a line. */
4214-
if (!equalpos(curwin->w_cursor, orig_pos))
4231+
if (!EQUAL_POS(curwin->w_cursor, orig_pos))
42154232
{
42164233
newlnum = curwin->w_cursor.lnum;
42174234
newcol = curwin->w_cursor.col;

src/ex_getln.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ getcmdline(
234234

235235
ccline.overstrike = FALSE; /* always start in insert mode */
236236
#ifdef FEAT_SEARCH_EXTRA
237-
clearpos(&match_end);
237+
CLEAR_POS(&match_end);
238238
save_cursor = curwin->w_cursor; /* may be restored later */
239239
search_start = curwin->w_cursor;
240240
old_curswant = curwin->w_curswant;
@@ -1479,7 +1479,7 @@ getcmdline(
14791479
if (did_incsearch)
14801480
{
14811481
curwin->w_cursor = match_end;
1482-
if (!equalpos(curwin->w_cursor, search_start))
1482+
if (!EQUAL_POS(curwin->w_cursor, search_start))
14831483
{
14841484
c = gchar_cursor();
14851485
/* If 'ignorecase' and 'smartcase' are set and the
@@ -1707,7 +1707,7 @@ getcmdline(
17071707
search_start = t;
17081708
(void)decl(&search_start);
17091709
}
1710-
if (lt(t, search_start) && c == Ctrl_G)
1710+
if (LT_POS(t, search_start) && c == Ctrl_G)
17111711
{
17121712
/* wrap around */
17131713
search_start = t;
@@ -2007,7 +2007,7 @@ getcmdline(
20072007
curwin->w_cursor = save_cursor;
20082008
else
20092009
{
2010-
if (!equalpos(save_cursor, search_start))
2010+
if (!EQUAL_POS(save_cursor, search_start))
20112011
{
20122012
/* put the '" mark at the original position */
20132013
curwin->w_cursor = save_cursor;

src/fileio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7118,7 +7118,7 @@ buf_reload(buf_T *buf, int orig_mode)
71187118
* the old contents. Can't use memory only, the file might be
71197119
* too big. Use a hidden buffer to move the buffer contents to.
71207120
*/
7121-
if (bufempty() || saved == FAIL)
7121+
if (BUFEMPTY() || saved == FAIL)
71227122
savebuf = NULL;
71237123
else
71247124
{
@@ -7161,7 +7161,7 @@ buf_reload(buf_T *buf, int orig_mode)
71617161
{
71627162
/* Put the text back from the save buffer. First
71637163
* delete any lines that readfile() added. */
7164-
while (!bufempty())
7164+
while (!BUFEMPTY())
71657165
if (ml_delete(buf->b_ml.ml_line_count, FALSE) == FAIL)
71667166
break;
71677167
(void)move_lines(savebuf, buf);

src/fold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ foldAdjustVisual(void)
10391039
if (!VIsual_active || !hasAnyFolding(curwin))
10401040
return;
10411041

1042-
if (ltoreq(VIsual, curwin->w_cursor))
1042+
if (LTOREQ_POS(VIsual, curwin->w_cursor))
10431043
{
10441044
start = &VIsual;
10451045
end = &curwin->w_cursor;

src/gui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4476,7 +4476,7 @@ gui_do_scroll(void)
44764476
pum_redraw();
44774477
#endif
44784478

4479-
return (wp == curwin && !equalpos(curwin->w_cursor, old_cursor));
4479+
return (wp == curwin && !EQUAL_POS(curwin->w_cursor, old_cursor));
44804480
}
44814481

44824482

@@ -5118,7 +5118,7 @@ gui_update_screen(void)
51185118
curwin->w_p_cole > 0
51195119
# endif
51205120
)
5121-
&& !equalpos(last_cursormoved, curwin->w_cursor))
5121+
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
51225122
{
51235123
# ifdef FEAT_AUTOCMD
51245124
if (has_cursormoved())

0 commit comments

Comments
 (0)