aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/globals.h1
-rw-r--r--src/nvim/move.c4
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/screen.c4
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/window.c8
9 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 90a564bb6a..efb8af50a4 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -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 {
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 0987cb3915..81cee5d535 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -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;
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 5d7246581c..0a44392080 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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 */
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 6d1bd1de12..f08812600f 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -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.
diff --git a/src/nvim/move.c b/src/nvim/move.c
index d5be4cb8c3..81d46a7f17 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -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;
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index f17075f0c4..4997209556 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -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;
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index a8353153fd..bcc996679b 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -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;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d372779c75..4e780f31ad 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -660,7 +660,7 @@ static const int included_patches[] = {
// 72 NA
// 71 NA
// 70 NA
- // 69,
+ 69,
68,
// 67 NA
66,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 29f5412ba0..7517d4e120 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -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;