Mercurial > vim
comparison src/if_ruby.c @ 12477:68d7bc045dbe v8.0.1118
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 16 20:54:51 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Sep 2017 21:00:06 +0200 |
parents | df498e3e34fc |
children | 972ea22c946f |
comparison
equal
deleted
inserted
replaced
12476:2516383741e6 | 12477:68d7bc045dbe |
---|---|
1422 | 1422 |
1423 | 1423 |
1424 | 1424 |
1425 static VALUE window_s_count(void) | 1425 static VALUE window_s_count(void) |
1426 { | 1426 { |
1427 #ifdef FEAT_WINDOWS | |
1428 win_T *w; | 1427 win_T *w; |
1429 int n = 0; | 1428 int n = 0; |
1430 | 1429 |
1431 FOR_ALL_WINDOWS(w) | 1430 FOR_ALL_WINDOWS(w) |
1432 n++; | 1431 n++; |
1433 return INT2NUM(n); | 1432 return INT2NUM(n); |
1434 #else | |
1435 return INT2NUM(1); | |
1436 #endif | |
1437 } | 1433 } |
1438 | 1434 |
1439 static VALUE window_s_aref(VALUE self UNUSED, VALUE num) | 1435 static VALUE window_s_aref(VALUE self UNUSED, VALUE num) |
1440 { | 1436 { |
1441 win_T *w; | 1437 win_T *w; |
1442 int n = NUM2INT(num); | 1438 int n = NUM2INT(num); |
1443 | 1439 |
1444 #ifndef FEAT_WINDOWS | |
1445 w = curwin; | |
1446 #else | |
1447 for (w = firstwin; w != NULL; w = w->w_next, --n) | 1440 for (w = firstwin; w != NULL; w = w->w_next, --n) |
1448 #endif | |
1449 if (n == 0) | 1441 if (n == 0) |
1450 return window_new(w); | 1442 return window_new(w); |
1451 return Qnil; | 1443 return Qnil; |
1452 } | 1444 } |
1453 | 1445 |
1481 return INT2NUM(W_WIDTH(get_win(self))); | 1473 return INT2NUM(W_WIDTH(get_win(self))); |
1482 } | 1474 } |
1483 | 1475 |
1484 static VALUE window_set_width(VALUE self UNUSED, VALUE width) | 1476 static VALUE window_set_width(VALUE self UNUSED, VALUE width) |
1485 { | 1477 { |
1486 #ifdef FEAT_WINDOWS | |
1487 win_T *win = get_win(self); | 1478 win_T *win = get_win(self); |
1488 win_T *savewin = curwin; | 1479 win_T *savewin = curwin; |
1489 | 1480 |
1490 curwin = win; | 1481 curwin = win; |
1491 win_setwidth(NUM2INT(width)); | 1482 win_setwidth(NUM2INT(width)); |
1492 curwin = savewin; | 1483 curwin = savewin; |
1493 #endif | |
1494 return width; | 1484 return width; |
1495 } | 1485 } |
1496 | 1486 |
1497 static VALUE window_cursor(VALUE self) | 1487 static VALUE window_cursor(VALUE self) |
1498 { | 1488 { |