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 */
|
||||
if (firstwin == lastwin
|
||||
if (ONE_WINDOW
|
||||
&& (first_tabpage->tp_next == NULL || !had_tab))
|
||||
use_firstwin = TRUE;
|
||||
else {
|
||||
|
@ -2806,7 +2806,7 @@ void ex_z(exarg_T *eap)
|
||||
* 'scroll' */
|
||||
if (eap->forceit)
|
||||
bigness = curwin->w_height;
|
||||
else if (firstwin == lastwin)
|
||||
else if (ONE_WINDOW)
|
||||
bigness = curwin->w_p_scr * 2;
|
||||
else
|
||||
bigness = curwin->w_height - 3;
|
||||
|
@ -5976,7 +5976,7 @@ static void ex_quit(exarg_T *eap)
|
||||
// specified. Example:
|
||||
// :h|wincmd w|1q - don't 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);
|
||||
}
|
||||
/* close window; may free buffer */
|
||||
|
@ -494,6 +494,7 @@ EXTERN int updating_screen INIT(= FALSE);
|
||||
EXTERN win_T *firstwin; /* first window */
|
||||
EXTERN win_T *lastwin; /* last 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"
|
||||
* to break out of the tabpage loop.
|
||||
|
@ -1763,7 +1763,7 @@ int onepage(int dir, long count)
|
||||
|
||||
loff.fill = 0;
|
||||
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 */
|
||||
if (p_window <= 2)
|
||||
++curwin->w_topline;
|
||||
@ -1797,7 +1797,7 @@ int onepage(int dir, long count)
|
||||
max_topfill();
|
||||
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) */
|
||||
if (p_window <= 2)
|
||||
--curwin->w_topline;
|
||||
|
@ -1878,7 +1878,7 @@ win_found:
|
||||
* If there is only one window and it is the quickfix window, create a
|
||||
* 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;
|
||||
if (ll_ref != NULL)
|
||||
flags |= WSP_NEWLOC;
|
||||
|
@ -991,7 +991,7 @@ static void win_update(win_T *wp)
|
||||
* first. */
|
||||
if (mid_start == 0) {
|
||||
mid_end = wp->w_height;
|
||||
if (lastwin == firstwin) {
|
||||
if (ONE_WINDOW) {
|
||||
/* Clear the screen when it was not done by win_del_lines() or
|
||||
* win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
|
||||
* 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
|
||||
* current window */
|
||||
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))) {
|
||||
return fill;
|
||||
}
|
||||
|
@ -660,7 +660,7 @@ static const int included_patches[] = {
|
||||
// 72 NA
|
||||
// 71 NA
|
||||
// 70 NA
|
||||
// 69,
|
||||
69,
|
||||
68,
|
||||
// 67 NA
|
||||
66,
|
||||
|
@ -193,7 +193,7 @@ newwindow:
|
||||
/* cursor to previous window with wrap around */
|
||||
case 'W':
|
||||
CHECK_CMDWIN
|
||||
if (firstwin == lastwin && Prenum != 1) /* just one window */
|
||||
if (ONE_WINDOW && Prenum != 1) /* just one window */
|
||||
beep_flush();
|
||||
else {
|
||||
if (Prenum) { /* go to specified window */
|
||||
@ -1271,7 +1271,7 @@ static void win_rotate(int upwards, int count)
|
||||
frame_T *frp;
|
||||
int n;
|
||||
|
||||
if (firstwin == lastwin) { /* nothing to do */
|
||||
if (ONE_WINDOW) { /* nothing to do */
|
||||
beep_flush();
|
||||
return;
|
||||
}
|
||||
@ -2194,7 +2194,7 @@ winframe_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;
|
||||
|
||||
/*
|
||||
@ -2331,7 +2331,7 @@ win_altframe (
|
||||
frame_T *frp;
|
||||
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. */
|
||||
return alt_tabpage()->tp_curwin->w_frame;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user