mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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)
This commit is contained in:
committed by
Bram Moolenaar
parent
4ba5f1dab6
commit
7904fa420e
24
src/window.c
24
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;
|
||||
|
Reference in New Issue
Block a user