mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0069
Problem: Compiler warning for self-comparison.
Solution: Define ONE_WINDOW and add vim/vim#ifdef.
a1f4cb93ba
This commit is contained in:
parent
253f6f3bbf
commit
ad07e9c7fc
@ -4429,7 +4429,7 @@ do_arg_all (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* don't close last window */
|
/* don't close last window */
|
||||||
if (firstwin == lastwin
|
if (ONE_WINDOW
|
||||||
&& (first_tabpage->tp_next == NULL || !had_tab))
|
&& (first_tabpage->tp_next == NULL || !had_tab))
|
||||||
use_firstwin = TRUE;
|
use_firstwin = TRUE;
|
||||||
else {
|
else {
|
||||||
|
@ -2806,7 +2806,7 @@ void ex_z(exarg_T *eap)
|
|||||||
* 'scroll' */
|
* 'scroll' */
|
||||||
if (eap->forceit)
|
if (eap->forceit)
|
||||||
bigness = curwin->w_height;
|
bigness = curwin->w_height;
|
||||||
else if (firstwin == lastwin)
|
else if (ONE_WINDOW)
|
||||||
bigness = curwin->w_p_scr * 2;
|
bigness = curwin->w_p_scr * 2;
|
||||||
else
|
else
|
||||||
bigness = curwin->w_height - 3;
|
bigness = curwin->w_height - 3;
|
||||||
|
@ -5976,7 +5976,7 @@ static void ex_quit(exarg_T *eap)
|
|||||||
// specified. Example:
|
// specified. Example:
|
||||||
// :h|wincmd w|1q - don't quit
|
// :h|wincmd w|1q - don't quit
|
||||||
// :h|wincmd w|q - quit
|
// :h|wincmd w|q - quit
|
||||||
if (only_one_window() && (firstwin == lastwin || eap->addr_count == 0)) {
|
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0)) {
|
||||||
getout(0);
|
getout(0);
|
||||||
}
|
}
|
||||||
/* close window; may free buffer */
|
/* close window; may free buffer */
|
||||||
|
@ -494,6 +494,7 @@ EXTERN int updating_screen INIT(= FALSE);
|
|||||||
EXTERN win_T *firstwin; /* first window */
|
EXTERN win_T *firstwin; /* first window */
|
||||||
EXTERN win_T *lastwin; /* last window */
|
EXTERN win_T *lastwin; /* last window */
|
||||||
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||||
|
# define ONE_WINDOW (firstwin == lastwin)
|
||||||
/*
|
/*
|
||||||
* When using this macro "break" only breaks out of the inner loop. Use "goto"
|
* When using this macro "break" only breaks out of the inner loop. Use "goto"
|
||||||
* to break out of the tabpage loop.
|
* to break out of the tabpage loop.
|
||||||
|
@ -1763,7 +1763,7 @@ int onepage(int dir, long count)
|
|||||||
|
|
||||||
loff.fill = 0;
|
loff.fill = 0;
|
||||||
if (dir == FORWARD) {
|
if (dir == FORWARD) {
|
||||||
if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1) {
|
if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1) {
|
||||||
/* Vi compatible scrolling */
|
/* Vi compatible scrolling */
|
||||||
if (p_window <= 2)
|
if (p_window <= 2)
|
||||||
++curwin->w_topline;
|
++curwin->w_topline;
|
||||||
@ -1797,7 +1797,7 @@ int onepage(int dir, long count)
|
|||||||
max_topfill();
|
max_topfill();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1) {
|
if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1) {
|
||||||
/* Vi compatible scrolling (sort of) */
|
/* Vi compatible scrolling (sort of) */
|
||||||
if (p_window <= 2)
|
if (p_window <= 2)
|
||||||
--curwin->w_topline;
|
--curwin->w_topline;
|
||||||
|
@ -1878,7 +1878,7 @@ win_found:
|
|||||||
* If there is only one window and it is the quickfix window, create a
|
* If there is only one window and it is the quickfix window, create a
|
||||||
* new one above the quickfix window.
|
* new one above the quickfix window.
|
||||||
*/
|
*/
|
||||||
if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win) {
|
if ((ONE_WINDOW && bt_quickfix(curbuf)) || !usable_win) {
|
||||||
flags = WSP_ABOVE;
|
flags = WSP_ABOVE;
|
||||||
if (ll_ref != NULL)
|
if (ll_ref != NULL)
|
||||||
flags |= WSP_NEWLOC;
|
flags |= WSP_NEWLOC;
|
||||||
|
@ -991,7 +991,7 @@ static void win_update(win_T *wp)
|
|||||||
* first. */
|
* first. */
|
||||||
if (mid_start == 0) {
|
if (mid_start == 0) {
|
||||||
mid_end = wp->w_height;
|
mid_end = wp->w_height;
|
||||||
if (lastwin == firstwin) {
|
if (ONE_WINDOW) {
|
||||||
/* Clear the screen when it was not done by win_del_lines() or
|
/* Clear the screen when it was not done by win_del_lines() or
|
||||||
* win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
|
* win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
|
||||||
* then. */
|
* then. */
|
||||||
@ -7160,7 +7160,7 @@ static int fillchar_status(int *attr, win_T *wp)
|
|||||||
* window differs, or the fillchars differ, or this is not the
|
* window differs, or the fillchars differ, or this is not the
|
||||||
* current window */
|
* current window */
|
||||||
if (*attr != 0 && ((win_hl_attr(wp, HLF_S) != win_hl_attr(wp, HLF_SNC)
|
if (*attr != 0 && ((win_hl_attr(wp, HLF_S) != win_hl_attr(wp, HLF_SNC)
|
||||||
|| !is_curwin || firstwin == lastwin)
|
|| !is_curwin || ONE_WINDOW)
|
||||||
|| (fill_stl != fill_stlnc))) {
|
|| (fill_stl != fill_stlnc))) {
|
||||||
return fill;
|
return fill;
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ static const int included_patches[] = {
|
|||||||
// 72 NA
|
// 72 NA
|
||||||
// 71 NA
|
// 71 NA
|
||||||
// 70 NA
|
// 70 NA
|
||||||
// 69,
|
69,
|
||||||
68,
|
68,
|
||||||
// 67 NA
|
// 67 NA
|
||||||
66,
|
66,
|
||||||
|
@ -193,7 +193,7 @@ newwindow:
|
|||||||
/* cursor to previous window with wrap around */
|
/* cursor to previous window with wrap around */
|
||||||
case 'W':
|
case 'W':
|
||||||
CHECK_CMDWIN
|
CHECK_CMDWIN
|
||||||
if (firstwin == lastwin && Prenum != 1) /* just one window */
|
if (ONE_WINDOW && Prenum != 1) /* just one window */
|
||||||
beep_flush();
|
beep_flush();
|
||||||
else {
|
else {
|
||||||
if (Prenum) { /* go to specified window */
|
if (Prenum) { /* go to specified window */
|
||||||
@ -1271,7 +1271,7 @@ static void win_rotate(int upwards, int count)
|
|||||||
frame_T *frp;
|
frame_T *frp;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (firstwin == lastwin) { /* nothing to do */
|
if (ONE_WINDOW) { /* nothing to do */
|
||||||
beep_flush();
|
beep_flush();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2194,7 +2194,7 @@ winframe_remove (
|
|||||||
/*
|
/*
|
||||||
* If there is only one window there is nothing to remove.
|
* If there is only one window there is nothing to remove.
|
||||||
*/
|
*/
|
||||||
if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
|
if (tp == NULL ? ONE_WINDOW : tp->tp_firstwin == tp->tp_lastwin)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2331,7 +2331,7 @@ win_altframe (
|
|||||||
frame_T *frp;
|
frame_T *frp;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
|
if (tp == NULL ? ONE_WINDOW : tp->tp_firstwin == tp->tp_lastwin)
|
||||||
/* Last window in this tab page, will go to next tab page. */
|
/* Last window in this tab page, will go to next tab page. */
|
||||||
return alt_tabpage()->tp_curwin->w_frame;
|
return alt_tabpage()->tp_curwin->w_frame;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user