diff options
-rw-r--r-- | src/nvim/cursor.c | 2 | ||||
-rw-r--r-- | src/nvim/fold.c | 11 | ||||
-rw-r--r-- | src/nvim/misc1.c | 8 | ||||
-rw-r--r-- | src/nvim/move.c | 4 | ||||
-rw-r--r-- | src/nvim/window.c | 4 |
5 files changed, 14 insertions, 15 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index cd84d7014c..afaa6022c9 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -282,7 +282,7 @@ linenr_T get_cursor_rel_lnum(win_T *wp, linenr_T lnum) // Loop until we reach to_line, skipping folds. for (; from_line < to_line; from_line++, retval++) { // If from_line is in a fold, set it to the last line of that fold. - hasFoldingWin(wp, from_line, NULL, &from_line, true, NULL); + (void)hasFoldingWin(wp, from_line, NULL, &from_line, true, NULL); } // If to_line is in a closed fold, the line count is off by +1. Correct it. diff --git a/src/nvim/fold.c b/src/nvim/fold.c index ab557ecf68..784faa35a3 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -150,12 +150,11 @@ int hasAnyFolding(win_T *win) */ int hasFolding(linenr_T lnum, linenr_T *firstp, linenr_T *lastp) { - return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL); + return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL) ? TRUE : FALSE; } /* hasFoldingWin() {{{2 */ -int -hasFoldingWin ( +bool hasFoldingWin( win_T *win, linenr_T lnum, linenr_T *firstp, @@ -183,7 +182,7 @@ hasFoldingWin ( if (!hasAnyFolding(win)) { if (infop != NULL) infop->fi_level = 0; - return FALSE; + return false; } if (cache) { @@ -238,7 +237,7 @@ hasFoldingWin ( infop->fi_lnum = lnum - lnum_rel; infop->fi_low_level = low_level == 0 ? level : low_level; } - return FALSE; + return false; } if (last > win->w_buffer->b_ml.ml_line_count) { @@ -253,7 +252,7 @@ hasFoldingWin ( infop->fi_lnum = first; infop->fi_low_level = low_level == 0 ? level + 1 : low_level; } - return TRUE; + return true; } /* foldLevel() {{{2 */ diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index fd922375e3..8407198b13 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -2120,12 +2120,12 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra * might be displayed differently. * Set w_cline_folded here as an efficient way to update it when * inserting lines just above a closed fold. */ - i = hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL); + bool folded = hasFoldingWin(wp, lnum, &lnum, NULL, false, NULL); if (wp->w_cursor.lnum == lnum) - wp->w_cline_folded = (i == TRUE); - i = hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL); + wp->w_cline_folded = folded; + folded = hasFoldingWin(wp, lnume, NULL, &lnume, false, NULL); if (wp->w_cursor.lnum == lnume) - wp->w_cline_folded = (i == TRUE); + wp->w_cline_folded = folded; /* If the changed line is in a range of previously folded lines, * compare with the first line in that range. */ diff --git a/src/nvim/move.c b/src/nvim/move.c index 7e0d1ed775..6a00f66c52 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -596,12 +596,12 @@ 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) == TRUE; + NULL, NULL, TRUE, NULL); } 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) == TRUE; + NULL, NULL, TRUE, NULL); } else { wp->w_cline_height = wp->w_lines[i].wl_size; wp->w_cline_folded = wp->w_lines[i].wl_folded == TRUE; diff --git a/src/nvim/window.c b/src/nvim/window.c index 161f653536..992463a8fc 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4673,7 +4673,7 @@ void win_new_height(win_T *wp, int height) set_topline(wp, lnum); } else if (sline > 0) { while (sline > 0 && lnum > 1) { - hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL); + (void)hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL); if (lnum == 1) { /* first line in buffer is folded */ line_size = 1; @@ -4694,7 +4694,7 @@ void win_new_height(win_T *wp, int height) * Line we want at top would go off top of screen. Use next * line instead. */ - hasFoldingWin(wp, lnum, NULL, &lnum, TRUE, NULL); + (void)hasFoldingWin(wp, lnum, NULL, &lnum, true, NULL); lnum++; wp->w_wrow -= line_size + sline; } else if (sline > 0) { |