Permalink
Browse files

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.
  • Loading branch information...
brammool committed Sep 16, 2017
1 parent e738a1a commit 4033c55eca575777718c0701e26635a0cc47d907
Showing with 237 additions and 1,589 deletions.
  1. +21 −100 src/buffer.c
  2. +2 −8 src/charset.c
  3. +0 −4 src/digraph.c
  4. +3 −29 src/edit.c
  5. +0 −47 src/eval.c
  6. +1 −58 src/evalfunc.c
  7. +3 −49 src/ex_cmds.c
  8. +9 −48 src/ex_cmds2.c
  9. +43 −153 src/ex_docmd.c
  10. +1 −3 src/ex_getln.c
  11. +9 −11 src/feature.h
  12. +5 −25 src/fileio.c
  13. +1 −2 src/fold.c
  14. +0 −2 src/getchar.c
  15. +1 −30 src/globals.h
  16. +6 −68 src/gui.c
  17. +0 −2 src/gui.h
  18. +0 −2 src/gui_athena.c
  19. +0 −8 src/gui_beval.c
  20. +0 −2 src/gui_gtk.c
  21. +0 −2 src/gui_motif.c
  22. +7 −13 src/gui_w32.c
  23. +2 −8 src/if_cscope.c
  24. +0 −4 src/if_lua.c
  25. +0 −14 src/if_mzsch.c
  26. +0 −18 src/if_perl.xs
  27. +0 −4 src/if_py_both.h
  28. +0 −2 src/if_python.c
  29. +0 −2 src/if_python3.c
  30. +0 −10 src/if_ruby.c
  31. +0 −2 src/if_tcl.c
  32. +4 −37 src/main.c
  33. +0 −8 src/mark.c
  34. +3 −3 src/memline.c
  35. +0 −15 src/misc1.c
  36. +1 −14 src/misc2.c
  37. +5 −26 src/move.c
  38. +0 −4 src/netbeans.c
  39. +7 −44 src/normal.c
  40. +10 −137 src/option.c
  41. +2 −18 src/option.h
  42. +4 −6 src/popupmnu.c
  43. +0 −35 src/quickfix.c
  44. +34 −229 src/screen.c
  45. +5 −7 src/search.c
  46. +0 −2 src/spell.c
  47. +2 −25 src/structs.h
  48. +0 −8 src/syntax.c
  49. +26 −31 src/tag.c
  50. +4 −19 src/term.c
  51. +0 −2 src/term.h
  52. +1 −1 src/testdir/test_normal.vim
  53. +2 −33 src/ui.c
  54. +2 −12 src/version.c
  55. +6 −18 src/vim.h
  56. +5 −123 src/window.c
  57. +0 −2 src/workshop.c
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1092,10 +1092,7 @@ win_lbr_chartabsize(
&& VIM_ISBREAK(c)
&& !VIM_ISBREAK((int)s[1])
&& wp->w_p_wrap
# ifdef FEAT_WINDOWS
&& wp->w_width != 0
# endif
)
&& wp->w_width != 0)
{
/*
* Count all characters from first non-blank after a blank up to next
@@ -1249,10 +1246,8 @@ in_win_border(win_T *wp, colnr_T vcol)
int width1; /* width of first line (after line number) */
int width2; /* width of further lines */
# ifdef FEAT_WINDOWS
if (wp->w_width == 0) /* there is no border */
return FALSE;
# endif
width1 = W_WIDTH(wp) - win_col_off(wp);
if ((int)vcol < width1 - 1)
return FALSE;
@@ -2029,8 +2024,7 @@ hex2nr(int c)
return c - '0';
}
#if defined(FEAT_TERMRESPONSE) \
|| (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) || defined(PROTO)
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Convert two hex characters to a byte.
* Return -1 if one of the characters is not hex.
View
@@ -2426,9 +2426,7 @@ ex_loadkeymap(exarg_T *eap)
p_cpo = save_cpo;
curbuf->b_kmap_state |= KEYMAP_LOADED;
#ifdef FEAT_WINDOWS
status_redraw_curbuf();
#endif
}
/*
@@ -2462,9 +2460,7 @@ keymap_unload(void)
ga_clear(&curbuf->b_kmap_ga);
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
#ifdef FEAT_WINDOWS
status_redraw_curbuf();
#endif
}
#endif /* FEAT_KEYMAP */
View
@@ -1360,7 +1360,7 @@ edit(
/* FALLTHROUGH */
case CAR:
case NL:
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
/* In a quickfix window a <CR> jumps to the error under the
* cursor. */
if (bt_quickfix(curbuf) && c == CAR)
@@ -4045,22 +4045,16 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
static buf_T *
ins_compl_next_buf(buf_T *buf, int flag)
{
#ifdef FEAT_WINDOWS
static win_T *wp;
#endif
if (flag == 'w') /* just windows */
{
#ifdef FEAT_WINDOWS
if (buf == curbuf) /* first call for this flag/expansion */
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)
;
buf = wp->w_buffer;
#else
buf = curbuf;
#endif
}
else
/* 'b' (just loaded buffers), 'u' (just non-loaded buffers) or 'U'
@@ -8540,7 +8534,7 @@ ins_ctrl_hat(void)
if (gui.in_use)
gui_update_cursor(TRUE, FALSE);
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
#if defined(FEAT_KEYMAP)
/* Show/unshow value of 'keymap' in status lines. */
status_redraw_curbuf();
#endif
@@ -9382,7 +9376,6 @@ ins_mouse(int c)
tpos = curwin->w_cursor;
if (do_mouse(NULL, c, BACKWARD, 1L, 0))
{
#ifdef FEAT_WINDOWS
win_T *new_curwin = curwin;
if (curwin != old_curwin && win_valid(old_curwin))
@@ -9392,40 +9385,32 @@ ins_mouse(int c)
curwin = old_curwin;
curbuf = curwin->w_buffer;
}
#endif
start_arrow(curwin == old_curwin ? &tpos : NULL);
#ifdef FEAT_WINDOWS
if (curwin != new_curwin && win_valid(new_curwin))
{
curwin = new_curwin;
curbuf = curwin->w_buffer;
}
#endif
# ifdef FEAT_CINDENT
can_cindent = TRUE;
# endif
}
#ifdef FEAT_WINDOWS
/* redraw status lines (in case another window became active) */
redraw_statuslines();
#endif
}
static void
ins_mousescroll(int dir)
{
pos_T tpos;
# if defined(FEAT_WINDOWS)
win_T *old_curwin = curwin, *wp;
# endif
# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
# endif
tpos = curwin->w_cursor;
# ifdef FEAT_WINDOWS
if (mouse_row >= 0 && mouse_col >= 0)
{
int row, col;
@@ -9441,16 +9426,11 @@ ins_mousescroll(int dir)
curbuf = curwin->w_buffer;
}
if (curwin == old_curwin)
# endif
undisplay_dollar();
# ifdef FEAT_INS_EXPAND
/* Don't scroll the window in which completion is being done. */
if (!pum_visible()
# if defined(FEAT_WINDOWS)
|| curwin != old_curwin
# endif
)
if (!pum_visible() || curwin != old_curwin)
# endif
{
if (dir == MSCR_DOWN || dir == MSCR_UP)
@@ -9479,12 +9459,10 @@ ins_mousescroll(int dir)
# endif
}
# ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
curwin = old_curwin;
curbuf = curwin->w_buffer;
# endif
# ifdef FEAT_INS_EXPAND
/* The popup menu may overlay the window, need to redraw it.
@@ -9883,7 +9861,6 @@ ins_pageup(void)
undisplay_dollar();
#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageUp>: tab page back */
@@ -9894,7 +9871,6 @@ ins_pageup(void)
}
return;
}
#endif
tpos = curwin->w_cursor;
if (onepage(BACKWARD, 1L) == OK)
@@ -9946,7 +9922,6 @@ ins_pagedown(void)
undisplay_dollar();
#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageDown>: tab page forward */
@@ -9957,7 +9932,6 @@ ins_pagedown(void)
}
return;
}
#endif
tpos = curwin->w_cursor;
if (onepage(FORWARD, 1L) == OK)
Oops, something went wrong.

0 comments on commit 4033c55

Please sign in to comment.