From 7904fa420eb577274c4c3711295240100167d495 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Tue, 4 Oct 2022 16:28:45 +0100 Subject: patch 9.0.0657: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate the +cmdwin feature. Now the tiny and small builds are equal, drop the small build. (Martin Tournoij, closes #11268) --- src/window.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index ad1852e4f..52c458e03 100644 --- a/src/window.c +++ b/src/window.c @@ -119,12 +119,8 @@ log_frame_layout(frame_T *frame) win_T * prevwin_curwin(void) { - return -#ifdef FEAT_CMDWIN - // In cmdwin, the alternative buffer should be used. - is_in_cmdwin() && prevwin != NULL ? prevwin : -#endif - curwin; + // In cmdwin, the alternative buffer should be used. + return is_in_cmdwin() && prevwin != NULL ? prevwin : curwin; } /* @@ -149,8 +145,7 @@ do_window( if (ERROR_IF_ANY_POPUP_WINDOW) return; -#ifdef FEAT_CMDWIN -# define CHECK_CMDWIN \ +#define CHECK_CMDWIN \ do { \ if (cmdwin_type != 0) \ { \ @@ -158,9 +153,6 @@ do_window( return; \ } \ } while (0) -#else -# define CHECK_CMDWIN do { /**/ } while (0) -#endif Prenum1 = Prenum == 0 ? 1 : Prenum; @@ -2963,10 +2955,9 @@ win_free_all(void) { int dummy; -#ifdef FEAT_CMDWIN // avoid an error for switching tabpage with the cmdline window open cmdwin_type = 0; -#endif + while (first_tabpage->tp_next != NULL) tabpage_close(TRUE); @@ -4019,13 +4010,11 @@ win_new_tabpage(int after) tabpage_T *newtp; int n; -#ifdef FEAT_CMDWIN if (cmdwin_type != 0) { emsg(_(e_invalid_in_cmdline_window)); return FAIL; } -#endif newtp = alloc_tabpage(); if (newtp == NULL) @@ -5513,7 +5502,6 @@ shell_new_columns(void) #endif } -#if defined(FEAT_CMDWIN) || defined(PROTO) /* * Save the size of all windows in "gap". */ @@ -5567,7 +5555,6 @@ win_size_restore(garray_T *gap) (void)win_comp_pos(); } } -#endif // FEAT_CMDWIN /* * Update the position for all windows, using the width and height of the @@ -6419,10 +6406,9 @@ win_fix_cursor(int normal) if (wp->w_buffer->b_ml.ml_line_count < wp->w_height) return; -#ifdef FEAT_CMDWIN if (skip_win_fix_cursor) return; -#endif + // Determine valid cursor range. so = MIN(wp->w_height / 2, so); wp->w_cursor.lnum = wp->w_topline; -- cgit v1.2.1