mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
win_T.w_cline_folded from int to bool
This commit is contained in:
parent
f39ac69824
commit
41778e2e10
@ -1007,7 +1007,7 @@ struct window_S {
|
||||
* that the cursor is on. We use this to avoid extra calls to plines().
|
||||
*/
|
||||
int w_cline_height; /* current size of cursor line */
|
||||
int w_cline_folded; /* cursor line is folded */
|
||||
bool w_cline_folded; /* cursor line is folded */
|
||||
|
||||
int w_cline_row; /* starting row of the cursor line */
|
||||
|
||||
|
@ -2122,10 +2122,10 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra
|
||||
* inserting lines just above a closed fold. */
|
||||
i = hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL);
|
||||
if (wp->w_cursor.lnum == lnum)
|
||||
wp->w_cline_folded = i;
|
||||
wp->w_cline_folded = (i == TRUE);
|
||||
i = hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL);
|
||||
if (wp->w_cursor.lnum == lnume)
|
||||
wp->w_cline_folded = i;
|
||||
wp->w_cline_folded = (i == TRUE);
|
||||
|
||||
/* If the changed line is in a range of previously folded lines,
|
||||
* compare with the first line in that range. */
|
||||
|
@ -58,7 +58,7 @@ static void comp_botline(win_T *wp)
|
||||
linenr_T lnum;
|
||||
int done;
|
||||
linenr_T last;
|
||||
int folded;
|
||||
bool folded;
|
||||
|
||||
/*
|
||||
* If w_cline_row is valid, start there.
|
||||
@ -75,10 +75,10 @@ static void comp_botline(win_T *wp)
|
||||
|
||||
for (; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) {
|
||||
last = lnum;
|
||||
folded = FALSE;
|
||||
folded = false;
|
||||
if (hasFoldingWin(wp, lnum, NULL, &last, TRUE, NULL)) {
|
||||
n = 1;
|
||||
folded = TRUE;
|
||||
folded = true;
|
||||
} else if (lnum == wp->w_topline)
|
||||
n = plines_win_nofill(wp, lnum, TRUE) + wp->w_topfill;
|
||||
else
|
||||
@ -596,15 +596,15 @@ static void curs_rows(win_T *wp)
|
||||
else
|
||||
wp->w_cline_height = plines_win(wp, wp->w_cursor.lnum, TRUE);
|
||||
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
||||
NULL, NULL, TRUE, NULL);
|
||||
NULL, NULL, TRUE, NULL) == TRUE;
|
||||
} else if (i > wp->w_lines_valid) {
|
||||
/* a line that is too long to fit on the last screen line */
|
||||
wp->w_cline_height = 0;
|
||||
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
||||
NULL, NULL, TRUE, NULL);
|
||||
NULL, NULL, TRUE, NULL) == TRUE;
|
||||
} else {
|
||||
wp->w_cline_height = wp->w_lines[i].wl_size;
|
||||
wp->w_cline_folded = wp->w_lines[i].wl_folded;
|
||||
wp->w_cline_folded = wp->w_lines[i].wl_folded == TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -648,7 +648,7 @@ static void validate_cheight(void)
|
||||
+ curwin->w_topfill;
|
||||
else
|
||||
curwin->w_cline_height = plines(curwin->w_cursor.lnum);
|
||||
curwin->w_cline_folded = hasFolding(curwin->w_cursor.lnum, NULL, NULL);
|
||||
curwin->w_cline_folded = hasFolding(curwin->w_cursor.lnum, NULL, NULL) == TRUE;
|
||||
curwin->w_valid |= VALID_CHEIGHT;
|
||||
}
|
||||
}
|
||||
|
@ -1992,7 +1992,7 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
|
||||
&& lnume >= curwin->w_cursor.lnum) {
|
||||
curwin->w_cline_row = row;
|
||||
curwin->w_cline_height = 1;
|
||||
curwin->w_cline_folded = TRUE;
|
||||
curwin->w_cline_folded = true;
|
||||
curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
|
||||
}
|
||||
}
|
||||
@ -3866,7 +3866,7 @@ win_line (
|
||||
if (wp == curwin && lnum == curwin->w_cursor.lnum) {
|
||||
curwin->w_cline_row = startrow;
|
||||
curwin->w_cline_height = row - startrow;
|
||||
curwin->w_cline_folded = FALSE;
|
||||
curwin->w_cline_folded = false;
|
||||
curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user