mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Replace TRUE/FALSE with true/false in move.c
This commit is contained in:
parent
16e9c853df
commit
600bb285f6
114
src/nvim/move.c
114
src/nvim/move.c
@ -76,13 +76,13 @@ static void comp_botline(win_T *wp)
|
|||||||
for (; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) {
|
for (; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum) {
|
||||||
last = lnum;
|
last = lnum;
|
||||||
folded = false;
|
folded = false;
|
||||||
if (hasFoldingWin(wp, lnum, NULL, &last, TRUE, NULL)) {
|
if (hasFoldingWin(wp, lnum, NULL, &last, true, NULL)) {
|
||||||
n = 1;
|
n = 1;
|
||||||
folded = true;
|
folded = true;
|
||||||
} else if (lnum == wp->w_topline)
|
} else if (lnum == wp->w_topline)
|
||||||
n = plines_win_nofill(wp, lnum, TRUE) + wp->w_topfill;
|
n = plines_win_nofill(wp, lnum, true) + wp->w_topfill;
|
||||||
else
|
else
|
||||||
n = plines_win(wp, lnum, TRUE);
|
n = plines_win(wp, lnum, true);
|
||||||
if (
|
if (
|
||||||
lnum <= wp->w_cursor.lnum && last >= wp->w_cursor.lnum
|
lnum <= wp->w_cursor.lnum && last >= wp->w_cursor.lnum
|
||||||
) {
|
) {
|
||||||
@ -140,11 +140,11 @@ void update_topline(void)
|
|||||||
linenr_T old_topline;
|
linenr_T old_topline;
|
||||||
int old_topfill;
|
int old_topfill;
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int check_topline = FALSE;
|
bool check_topline = false;
|
||||||
int check_botline = FALSE;
|
bool check_botline = false;
|
||||||
long save_so = p_so;
|
long save_so = p_so;
|
||||||
|
|
||||||
if (!screen_valid(TRUE))
|
if (!screen_valid(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If the window height is zero, just use the cursor line.
|
// If the window height is zero, just use the cursor line.
|
||||||
@ -188,14 +188,14 @@ void update_topline(void)
|
|||||||
* If the cursor is far below topline and there is no folding,
|
* If the cursor is far below topline and there is no folding,
|
||||||
* scrolling down is never needed. */
|
* scrolling down is never needed. */
|
||||||
if (curwin->w_cursor.lnum < curwin->w_topline)
|
if (curwin->w_cursor.lnum < curwin->w_topline)
|
||||||
check_topline = TRUE;
|
check_topline = true;
|
||||||
else if (check_top_offset())
|
else if (check_top_offset())
|
||||||
check_topline = TRUE;
|
check_topline = true;
|
||||||
}
|
}
|
||||||
/* Check if there are more filler lines than allowed. */
|
/* Check if there are more filler lines than allowed. */
|
||||||
if (!check_topline && curwin->w_topfill > diff_check_fill(curwin,
|
if (!check_topline && curwin->w_topfill > diff_check_fill(curwin,
|
||||||
curwin->w_topline))
|
curwin->w_topline))
|
||||||
check_topline = TRUE;
|
check_topline = true;
|
||||||
|
|
||||||
if (check_topline) {
|
if (check_topline) {
|
||||||
halfheight = curwin->w_height / 2 - 1;
|
halfheight = curwin->w_height / 2 - 1;
|
||||||
@ -222,15 +222,15 @@ void update_topline(void)
|
|||||||
* cursor in the middle of the window. Otherwise put the cursor
|
* cursor in the middle of the window. Otherwise put the cursor
|
||||||
* near the top of the window. */
|
* near the top of the window. */
|
||||||
if (n >= halfheight)
|
if (n >= halfheight)
|
||||||
scroll_cursor_halfway(FALSE);
|
scroll_cursor_halfway(false);
|
||||||
else {
|
else {
|
||||||
scroll_cursor_top(scrolljump_value(), FALSE);
|
scroll_cursor_top(scrolljump_value(), false);
|
||||||
check_botline = TRUE;
|
check_botline = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Make sure topline is the first line of a fold. */
|
/* Make sure topline is the first line of a fold. */
|
||||||
(void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
|
(void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
|
||||||
check_botline = TRUE;
|
check_botline = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,10 +274,10 @@ void update_topline(void)
|
|||||||
}
|
}
|
||||||
if (n >= p_so)
|
if (n >= p_so)
|
||||||
/* sufficient context, no need to scroll */
|
/* sufficient context, no need to scroll */
|
||||||
check_botline = FALSE;
|
check_botline = false;
|
||||||
} else
|
} else
|
||||||
/* sufficient context, no need to scroll */
|
/* sufficient context, no need to scroll */
|
||||||
check_botline = FALSE;
|
check_botline = false;
|
||||||
}
|
}
|
||||||
if (check_botline) {
|
if (check_botline) {
|
||||||
if (hasAnyFolding(curwin)) {
|
if (hasAnyFolding(curwin)) {
|
||||||
@ -297,9 +297,9 @@ void update_topline(void)
|
|||||||
line_count = curwin->w_cursor.lnum - curwin->w_botline
|
line_count = curwin->w_cursor.lnum - curwin->w_botline
|
||||||
+ 1 + p_so;
|
+ 1 + p_so;
|
||||||
if (line_count <= curwin->w_height + 1)
|
if (line_count <= curwin->w_height + 1)
|
||||||
scroll_cursor_bot(scrolljump_value(), FALSE);
|
scroll_cursor_bot(scrolljump_value(), false);
|
||||||
else
|
else
|
||||||
scroll_cursor_halfway(FALSE);
|
scroll_cursor_halfway(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,10 +349,10 @@ static int scrolljump_value(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE when there are not 'scrolloff' lines above the cursor for the
|
* Return true when there are not 'scrolloff' lines above the cursor for the
|
||||||
* current window.
|
* current window.
|
||||||
*/
|
*/
|
||||||
static int check_top_offset(void)
|
static bool check_top_offset(void)
|
||||||
{
|
{
|
||||||
lineoff_T loff;
|
lineoff_T loff;
|
||||||
int n;
|
int n;
|
||||||
@ -374,9 +374,9 @@ static int check_top_offset(void)
|
|||||||
n += loff.height;
|
n += loff.height;
|
||||||
}
|
}
|
||||||
if (n < p_so)
|
if (n < p_so)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_curswant(void)
|
void update_curswant(void)
|
||||||
@ -384,7 +384,7 @@ void update_curswant(void)
|
|||||||
if (curwin->w_set_curswant) {
|
if (curwin->w_set_curswant) {
|
||||||
validate_virtcol();
|
validate_virtcol();
|
||||||
curwin->w_curswant = curwin->w_virtcol;
|
curwin->w_curswant = curwin->w_virtcol;
|
||||||
curwin->w_set_curswant = FALSE;
|
curwin->w_set_curswant = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,11 +433,11 @@ void changed_window_setting_win(win_T *wp)
|
|||||||
void set_topline(win_T *wp, linenr_T lnum)
|
void set_topline(win_T *wp, linenr_T lnum)
|
||||||
{
|
{
|
||||||
/* go to first of folded lines */
|
/* go to first of folded lines */
|
||||||
(void)hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
(void)hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL);
|
||||||
/* Approximate the value of w_botline */
|
/* Approximate the value of w_botline */
|
||||||
wp->w_botline += lnum - wp->w_topline;
|
wp->w_botline += lnum - wp->w_topline;
|
||||||
wp->w_topline = lnum;
|
wp->w_topline = lnum;
|
||||||
wp->w_topline_was_set = TRUE;
|
wp->w_topline_was_set = true;
|
||||||
wp->w_topfill = 0;
|
wp->w_topfill = 0;
|
||||||
wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
|
wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
|
||||||
/* Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked. */
|
/* Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked. */
|
||||||
@ -506,7 +506,7 @@ void approximate_botline_win(win_T *wp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if curwin->w_wrow and curwin->w_wcol are valid.
|
* Return true if curwin->w_wrow and curwin->w_wcol are valid.
|
||||||
*/
|
*/
|
||||||
int cursor_valid(void)
|
int cursor_valid(void)
|
||||||
{
|
{
|
||||||
@ -523,7 +523,7 @@ void validate_cursor(void)
|
|||||||
{
|
{
|
||||||
check_cursor_moved(curwin);
|
check_cursor_moved(curwin);
|
||||||
if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW))
|
if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW))
|
||||||
curs_columns(TRUE);
|
curs_columns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -535,7 +535,7 @@ static void curs_rows(win_T *wp)
|
|||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int i;
|
int i;
|
||||||
int all_invalid;
|
int all_invalid;
|
||||||
int valid;
|
bool valid;
|
||||||
long fold_count;
|
long fold_count;
|
||||||
|
|
||||||
/* Check if wp->w_lines[].wl_size is invalid */
|
/* Check if wp->w_lines[].wl_size is invalid */
|
||||||
@ -545,7 +545,7 @@ static void curs_rows(win_T *wp)
|
|||||||
i = 0;
|
i = 0;
|
||||||
wp->w_cline_row = 0;
|
wp->w_cline_row = 0;
|
||||||
for (lnum = wp->w_topline; lnum < wp->w_cursor.lnum; ++i) {
|
for (lnum = wp->w_topline; lnum < wp->w_cursor.lnum; ++i) {
|
||||||
valid = FALSE;
|
valid = false;
|
||||||
if (!all_invalid && i < wp->w_lines_valid) {
|
if (!all_invalid && i < wp->w_lines_valid) {
|
||||||
if (wp->w_lines[i].wl_lnum < lnum || !wp->w_lines[i].wl_valid)
|
if (wp->w_lines[i].wl_lnum < lnum || !wp->w_lines[i].wl_valid)
|
||||||
continue; /* skip changed or deleted lines */
|
continue; /* skip changed or deleted lines */
|
||||||
@ -556,7 +556,7 @@ static void curs_rows(win_T *wp)
|
|||||||
|| wp->w_lines[i].wl_lastlnum < wp->w_cursor.lnum
|
|| wp->w_lines[i].wl_lastlnum < wp->w_cursor.lnum
|
||||||
|| wp->w_buffer->b_mod_top
|
|| wp->w_buffer->b_mod_top
|
||||||
> wp->w_lines[i].wl_lastlnum + 1)
|
> wp->w_lines[i].wl_lastlnum + 1)
|
||||||
valid = TRUE;
|
valid = true;
|
||||||
} else if (wp->w_lines[i].wl_lnum > lnum)
|
} else if (wp->w_lines[i].wl_lnum > lnum)
|
||||||
--i; /* hold at inserted lines */
|
--i; /* hold at inserted lines */
|
||||||
}
|
}
|
||||||
@ -576,10 +576,10 @@ static void curs_rows(win_T *wp)
|
|||||||
break;
|
break;
|
||||||
++wp->w_cline_row;
|
++wp->w_cline_row;
|
||||||
} else if (lnum == wp->w_topline)
|
} else if (lnum == wp->w_topline)
|
||||||
wp->w_cline_row += plines_win_nofill(wp, lnum++, TRUE)
|
wp->w_cline_row += plines_win_nofill(wp, lnum++, true)
|
||||||
+ wp->w_topfill;
|
+ wp->w_topfill;
|
||||||
else
|
else
|
||||||
wp->w_cline_row += plines_win(wp, lnum++, TRUE);
|
wp->w_cline_row += plines_win(wp, lnum++, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,19 +592,19 @@ static void curs_rows(win_T *wp)
|
|||||||
|| wp->w_lines[i].wl_lnum != wp->w_cursor.lnum))) {
|
|| wp->w_lines[i].wl_lnum != wp->w_cursor.lnum))) {
|
||||||
if (wp->w_cursor.lnum == wp->w_topline)
|
if (wp->w_cursor.lnum == wp->w_topline)
|
||||||
wp->w_cline_height = plines_win_nofill(wp, wp->w_cursor.lnum,
|
wp->w_cline_height = plines_win_nofill(wp, wp->w_cursor.lnum,
|
||||||
TRUE) + wp->w_topfill;
|
true) + wp->w_topfill;
|
||||||
else
|
else
|
||||||
wp->w_cline_height = plines_win(wp, wp->w_cursor.lnum, TRUE);
|
wp->w_cline_height = plines_win(wp, wp->w_cursor.lnum, true);
|
||||||
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
||||||
NULL, NULL, TRUE, NULL);
|
NULL, NULL, true, NULL);
|
||||||
} else if (i > wp->w_lines_valid) {
|
} else if (i > wp->w_lines_valid) {
|
||||||
/* a line that is too long to fit on the last screen line */
|
/* a line that is too long to fit on the last screen line */
|
||||||
wp->w_cline_height = 0;
|
wp->w_cline_height = 0;
|
||||||
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
|
||||||
NULL, NULL, TRUE, NULL);
|
NULL, NULL, true, NULL);
|
||||||
} else {
|
} else {
|
||||||
wp->w_cline_height = wp->w_lines[i].wl_size;
|
wp->w_cline_height = wp->w_lines[i].wl_size;
|
||||||
wp->w_cline_folded = wp->w_lines[i].wl_folded == TRUE;
|
wp->w_cline_folded = wp->w_lines[i].wl_folded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,7 +727,7 @@ int curwin_col_off2(void)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
curs_columns (
|
curs_columns (
|
||||||
int may_scroll /* when TRUE, may scroll horizontally */
|
int may_scroll /* when true, may scroll horizontally */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int diff;
|
int diff;
|
||||||
@ -864,7 +864,7 @@ curs_columns (
|
|||||||
|| curwin->w_wrow + p_so >= curwin->w_height)
|
|| curwin->w_wrow + p_so >= curwin->w_height)
|
||||||
&& (p_lines =
|
&& (p_lines =
|
||||||
plines_win_nofill
|
plines_win_nofill
|
||||||
(curwin, curwin->w_cursor.lnum, FALSE))
|
(curwin, curwin->w_cursor.lnum, false))
|
||||||
- 1 >= curwin->w_height))
|
- 1 >= curwin->w_height))
|
||||||
&& curwin->w_height != 0
|
&& curwin->w_height != 0
|
||||||
&& curwin->w_cursor.lnum == curwin->w_topline
|
&& curwin->w_cursor.lnum == curwin->w_topline
|
||||||
@ -883,7 +883,7 @@ curs_columns (
|
|||||||
/* Compute last display line of the buffer line that we want at the
|
/* Compute last display line of the buffer line that we want at the
|
||||||
* bottom of the window. */
|
* bottom of the window. */
|
||||||
if (p_lines == 0)
|
if (p_lines == 0)
|
||||||
p_lines = plines_win(curwin, curwin->w_cursor.lnum, FALSE);
|
p_lines = plines_win(curwin, curwin->w_cursor.lnum, false);
|
||||||
--p_lines;
|
--p_lines;
|
||||||
if (p_lines > curwin->w_wrow + p_so) {
|
if (p_lines > curwin->w_wrow + p_so) {
|
||||||
assert(p_so <= INT_MAX);
|
assert(p_so <= INT_MAX);
|
||||||
@ -934,9 +934,9 @@ curs_columns (
|
|||||||
|
|
||||||
extra = ((int)prev_skipcol - (int)curwin->w_skipcol) / width;
|
extra = ((int)prev_skipcol - (int)curwin->w_skipcol) / width;
|
||||||
if (extra > 0)
|
if (extra > 0)
|
||||||
win_ins_lines(curwin, 0, extra, FALSE, FALSE);
|
win_ins_lines(curwin, 0, extra, false, false);
|
||||||
else if (extra < 0)
|
else if (extra < 0)
|
||||||
win_del_lines(curwin, 0, -extra, FALSE, FALSE);
|
win_del_lines(curwin, 0, -extra, false, false);
|
||||||
} else
|
} else
|
||||||
curwin->w_skipcol = 0;
|
curwin->w_skipcol = 0;
|
||||||
if (prev_skipcol != curwin->w_skipcol)
|
if (prev_skipcol != curwin->w_skipcol)
|
||||||
@ -957,12 +957,12 @@ curs_columns (
|
|||||||
void
|
void
|
||||||
scrolldown (
|
scrolldown (
|
||||||
long line_count,
|
long line_count,
|
||||||
int byfold /* TRUE: count a closed fold as one line */
|
int byfold /* true: count a closed fold as one line */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int done = 0; /* total # of physical lines done */
|
int done = 0; /* total # of physical lines done */
|
||||||
int wrow;
|
int wrow;
|
||||||
int moved = FALSE;
|
bool moved = false;
|
||||||
|
|
||||||
linenr_T first;
|
linenr_T first;
|
||||||
|
|
||||||
@ -1023,7 +1023,7 @@ scrolldown (
|
|||||||
wrow -= plines(curwin->w_cursor.lnum--);
|
wrow -= plines(curwin->w_cursor.lnum--);
|
||||||
curwin->w_valid &=
|
curwin->w_valid &=
|
||||||
~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL);
|
~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL);
|
||||||
moved = TRUE;
|
moved = true;
|
||||||
}
|
}
|
||||||
if (moved) {
|
if (moved) {
|
||||||
/* Move cursor to first line of closed fold. */
|
/* Move cursor to first line of closed fold. */
|
||||||
@ -1038,7 +1038,7 @@ scrolldown (
|
|||||||
void
|
void
|
||||||
scrollup (
|
scrollup (
|
||||||
long line_count,
|
long line_count,
|
||||||
int byfold /* TRUE: count a closed fold as one line */
|
int byfold /* true: count a closed fold as one line */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
@ -1096,13 +1096,13 @@ scrollup (
|
|||||||
void
|
void
|
||||||
check_topfill (
|
check_topfill (
|
||||||
win_T *wp,
|
win_T *wp,
|
||||||
bool down /* when TRUE scroll down when not enough space */
|
bool down /* when true scroll down when not enough space */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (wp->w_topfill > 0) {
|
if (wp->w_topfill > 0) {
|
||||||
n = plines_win_nofill(wp, wp->w_topline, TRUE);
|
n = plines_win_nofill(wp, wp->w_topline, true);
|
||||||
if (wp->w_topfill + n > wp->w_height) {
|
if (wp->w_topfill + n > wp->w_height) {
|
||||||
if (down && wp->w_topline > 1) {
|
if (down && wp->w_topline > 1) {
|
||||||
--wp->w_topline;
|
--wp->w_topline;
|
||||||
@ -1304,7 +1304,7 @@ static void topline_botline(lineoff_T *lp)
|
|||||||
/*
|
/*
|
||||||
* Recompute topline to put the cursor at the top of the window.
|
* Recompute topline to put the cursor at the top of the window.
|
||||||
* Scroll at least "min_scroll" lines.
|
* Scroll at least "min_scroll" lines.
|
||||||
* If "always" is TRUE, always set topline (for "zt").
|
* If "always" is true, always set topline (for "zt").
|
||||||
*/
|
*/
|
||||||
void scroll_cursor_top(int min_scroll, int always)
|
void scroll_cursor_top(int min_scroll, int always)
|
||||||
{
|
{
|
||||||
@ -1391,10 +1391,10 @@ void scroll_cursor_top(int min_scroll, int always)
|
|||||||
* in a small window.
|
* in a small window.
|
||||||
*/
|
*/
|
||||||
if (used > curwin->w_height)
|
if (used > curwin->w_height)
|
||||||
scroll_cursor_halfway(FALSE);
|
scroll_cursor_halfway(false);
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
* If "always" is FALSE, only adjust topline to a lower value, higher
|
* If "always" is false, only adjust topline to a lower value, higher
|
||||||
* value may happen with wrapping lines
|
* value may happen with wrapping lines
|
||||||
*/
|
*/
|
||||||
if (new_topline < curwin->w_topline || always)
|
if (new_topline < curwin->w_topline || always)
|
||||||
@ -1443,7 +1443,7 @@ void set_empty_rows(win_T *wp, int used)
|
|||||||
/*
|
/*
|
||||||
* Recompute topline to put the cursor at the bottom of the window.
|
* Recompute topline to put the cursor at the bottom of the window.
|
||||||
* Scroll at least "min_scroll" lines.
|
* Scroll at least "min_scroll" lines.
|
||||||
* If "set_topbot" is TRUE, set topline and botline first (for "zb").
|
* If "set_topbot" is true, set topline and botline first (for "zb").
|
||||||
* This is messy stuff!!!
|
* This is messy stuff!!!
|
||||||
*/
|
*/
|
||||||
void scroll_cursor_bot(int min_scroll, int set_topbot)
|
void scroll_cursor_bot(int min_scroll, int set_topbot)
|
||||||
@ -1599,9 +1599,9 @@ void scroll_cursor_bot(int min_scroll, int set_topbot)
|
|||||||
* Otherwise put it at 1/2 of the screen.
|
* Otherwise put it at 1/2 of the screen.
|
||||||
*/
|
*/
|
||||||
if (line_count >= curwin->w_height && line_count > min_scroll)
|
if (line_count >= curwin->w_height && line_count > min_scroll)
|
||||||
scroll_cursor_halfway(FALSE);
|
scroll_cursor_halfway(false);
|
||||||
else
|
else
|
||||||
scrollup(line_count, TRUE);
|
scrollup(line_count, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If topline didn't change we need to restore w_botline and w_empty_rows
|
* If topline didn't change we need to restore w_botline and w_empty_rows
|
||||||
@ -1618,7 +1618,7 @@ void scroll_cursor_bot(int min_scroll, int set_topbot)
|
|||||||
|
|
||||||
/// Recompute topline to put the cursor halfway across the window
|
/// Recompute topline to put the cursor halfway across the window
|
||||||
///
|
///
|
||||||
/// @param atend if TRUE, also put the cursor halfway to the end of the file.
|
/// @param atend if true, also put the cursor halfway to the end of the file.
|
||||||
///
|
///
|
||||||
void scroll_cursor_halfway(int atend)
|
void scroll_cursor_halfway(int atend)
|
||||||
{
|
{
|
||||||
@ -1947,7 +1947,7 @@ int onepage(int dir, long count)
|
|||||||
* wrapping lines and non-wrapping line).
|
* wrapping lines and non-wrapping line).
|
||||||
*/
|
*/
|
||||||
if (retval == OK && dir == FORWARD && check_top_offset()) {
|
if (retval == OK && dir == FORWARD && check_top_offset()) {
|
||||||
scroll_cursor_top(1, FALSE);
|
scroll_cursor_top(1, false);
|
||||||
if (curwin->w_topline <= old_topline
|
if (curwin->w_topline <= old_topline
|
||||||
&& old_topline < curbuf->b_ml.ml_line_count) {
|
&& old_topline < curbuf->b_ml.ml_line_count) {
|
||||||
curwin->w_topline = old_topline + 1;
|
curwin->w_topline = old_topline + 1;
|
||||||
@ -2221,7 +2221,7 @@ void do_check_cursorbind(void)
|
|||||||
/* Make sure the cursor is in a valid position. Temporarily set
|
/* Make sure the cursor is in a valid position. Temporarily set
|
||||||
* "restart_edit" to allow the cursor to be beyond the EOL. */
|
* "restart_edit" to allow the cursor to be beyond the EOL. */
|
||||||
restart_edit_save = restart_edit;
|
restart_edit_save = restart_edit;
|
||||||
restart_edit = TRUE;
|
restart_edit = true;
|
||||||
check_cursor();
|
check_cursor();
|
||||||
restart_edit = restart_edit_save;
|
restart_edit = restart_edit_save;
|
||||||
/* Correct cursor for multi-byte character. */
|
/* Correct cursor for multi-byte character. */
|
||||||
@ -2232,7 +2232,7 @@ void do_check_cursorbind(void)
|
|||||||
/* Only scroll when 'scrollbind' hasn't done this. */
|
/* Only scroll when 'scrollbind' hasn't done this. */
|
||||||
if (!curwin->w_p_scb)
|
if (!curwin->w_p_scb)
|
||||||
update_topline();
|
update_topline();
|
||||||
curwin->w_redr_status = TRUE;
|
curwin->w_redr_status = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user