From ad07e9c7fcabeb991f0849c9e11b5b225cf470fd Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sun, 23 Jul 2017 10:12:05 +0800 Subject: vim-patch:8.0.0069 Problem: Compiler warning for self-comparison. Solution: Define ONE_WINDOW and add vim/vim#ifdef. https://github.com/vim/vim/commit/a1f4cb93ba50ea9e40cd4b1f5592b8a6d1398660 --- src/nvim/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer.c') 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 { -- cgit From b656159fcfded40839c222ae1c4e86873c82f295 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sun, 23 Jul 2017 11:11:56 +0800 Subject: vim-patch:8.0.0073 Problem: More comparisons between firstwin and lastwin. Solution: Use ONE_WINDOW for consistency. (Hirohito Higashi) https://github.com/vim/vim/commit/459ca563128f2edb7e3bb190090bbb755a56dd55 --- src/nvim/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index efb8af50a4..f5d8b6ad30 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1203,7 +1203,7 @@ do_buffer ( */ while (buf == curbuf && !(curwin->w_closing || curwin->w_buffer->b_locked > 0) - && (firstwin != lastwin || first_tabpage->tp_next != NULL)) { + && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) { if (win_close(curwin, FALSE) == FAIL) break; } @@ -4593,7 +4593,7 @@ void ex_buffer_all(exarg_T *eap) - tabline_height() : wp->w_width != Columns) || (had_tab > 0 && wp != firstwin)) - && firstwin != lastwin + && !ONE_WINDOW && !(wp->w_closing || wp->w_buffer->b_locked > 0) ) { win_close(wp, FALSE); -- cgit From 86f2c473dc0e5b3c886d71b2fee99e1f3c9849b6 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Mon, 24 Jul 2017 07:41:01 +0800 Subject: fix lint --- src/nvim/buffer.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f5d8b6ad30..724a8578ac 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1204,7 +1204,7 @@ do_buffer ( while (buf == curbuf && !(curwin->w_closing || curwin->w_buffer->b_locked > 0) && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) { - if (win_close(curwin, FALSE) == FAIL) + if (win_close(curwin, false) == FAIL) break; } @@ -4428,15 +4428,17 @@ do_arg_all ( continue; } } - /* don't close last window */ + // don't close last window if (ONE_WINDOW - && (first_tabpage->tp_next == NULL || !had_tab)) - use_firstwin = TRUE; - else { + && (first_tabpage->tp_next == NULL || !had_tab)) { + use_firstwin = true; + } else { win_close(wp, !P_HID(buf) && !bufIsChanged(buf)); - /* check if autocommands removed the next window */ - if (!win_valid(wpnext)) - wpnext = firstwin; /* start all over... */ + // check if autocommands removed the next window + if (!win_valid(wpnext)) { + // start all over... + wpnext = firstwin; + } } } } -- cgit