0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs

Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
This commit is contained in:
Bram Moolenaar
2017-09-16 20:54:51 +02:00
parent e738a1a033
commit 4033c55eca
57 changed files with 238 additions and 1590 deletions

View File

@@ -1424,16 +1424,12 @@ static VALUE current_line_number(void)
static VALUE window_s_count(void)
{
#ifdef FEAT_WINDOWS
win_T *w;
int n = 0;
FOR_ALL_WINDOWS(w)
n++;
return INT2NUM(n);
#else
return INT2NUM(1);
#endif
}
static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
@@ -1441,11 +1437,7 @@ static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
win_T *w;
int n = NUM2INT(num);
#ifndef FEAT_WINDOWS
w = curwin;
#else
for (w = firstwin; w != NULL; w = w->w_next, --n)
#endif
if (n == 0)
return window_new(w);
return Qnil;
@@ -1483,14 +1475,12 @@ static VALUE window_width(VALUE self UNUSED)
static VALUE window_set_width(VALUE self UNUSED, VALUE width)
{
#ifdef FEAT_WINDOWS
win_T *win = get_win(self);
win_T *savewin = curwin;
curwin = win;
win_setwidth(NUM2INT(width));
curwin = savewin;
#endif
return width;
}