summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-16 20:54:51 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-16 20:54:51 +0200
commit4033c55eca575777718c0701e26635a0cc47d907 (patch)
tree8dc460ad495106198a9119b52f6505033f7a75b3 /src/fileio.c
parente738a1a033cd31cd2568ba99a9e2dca1e65b45ea (diff)
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefsv8.0.1118
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.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 87a46b1b8f..0d1ac2d078 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4174,9 +4174,7 @@ buf_write(
#ifdef FEAT_TITLE
need_maketitle = TRUE; /* set window title later */
#endif
-#ifdef FEAT_WINDOWS
status_redraw_all(); /* redraw status lines later */
-#endif
}
if (end > buf->b_ml.ml_line_count)
@@ -6197,10 +6195,8 @@ shorten_fnames(int force)
* also have a swap file. */
mf_fullname(buf->b_ml.ml_mfp);
}
-#ifdef FEAT_WINDOWS
status_redraw_all();
redraw_tabline = TRUE;
-#endif
}
#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
@@ -8963,9 +8959,7 @@ aucmd_prepbuf(
buf_T *buf) /* new curbuf */
{
win_T *win;
-#ifdef FEAT_WINDOWS
int save_ea;
-#endif
#ifdef FEAT_AUTOCHDIR
int save_acd;
#endif
@@ -8974,13 +8968,9 @@ aucmd_prepbuf(
if (buf == curbuf) /* be quick when buf is curbuf */
win = curwin;
else
-#ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(win)
if (win->w_buffer == buf)
break;
-#else
- win = NULL;
-#endif
/* Allocate "aucmd_win" when needed. If this fails (out of memory) fall
* back to using the current window. */
@@ -9026,7 +9016,6 @@ aucmd_prepbuf(
globaldir = NULL;
-#ifdef FEAT_WINDOWS
/* Split the current window, put the aucmd_win in the upper half.
* We don't want the BufEnter or WinEnter autocommands. */
block_autocmds();
@@ -9034,20 +9023,19 @@ aucmd_prepbuf(
save_ea = p_ea;
p_ea = FALSE;
-# ifdef FEAT_AUTOCHDIR
+#ifdef FEAT_AUTOCHDIR
/* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
save_acd = p_acd;
p_acd = FALSE;
-# endif
+#endif
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
(void)win_comp_pos(); /* recompute window positions */
p_ea = save_ea;
-# ifdef FEAT_AUTOCHDIR
+#ifdef FEAT_AUTOCHDIR
p_acd = save_acd;
-# endif
- unblock_autocmds();
#endif
+ unblock_autocmds();
curwin = aucmd_win;
}
curbuf = buf;
@@ -9064,14 +9052,11 @@ aucmd_prepbuf(
aucmd_restbuf(
aco_save_T *aco) /* structure holding saved values */
{
-#ifdef FEAT_WINDOWS
int dummy;
-#endif
if (aco->use_aucmd_win)
{
--curbuf->b_nwindows;
-#ifdef FEAT_WINDOWS
/* Find "aucmd_win", it can't be closed, but it may be in another tab
* page. Do not trigger autocommands here. */
block_autocmds();
@@ -9112,12 +9097,9 @@ win_found:
else
/* Hmm, original window disappeared. Just use the first one. */
curwin = firstwin;
-# ifdef FEAT_EVAL
+#ifdef FEAT_EVAL
vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */
hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */
-# endif
-#else
- curwin = aco->save_curwin;
#endif
curbuf = curwin->w_buffer;
@@ -9143,9 +9125,7 @@ win_found:
else
{
/* restore curwin */
-#ifdef FEAT_WINDOWS
if (win_valid(aco->save_curwin))
-#endif
{
/* Restore the buffer which was previously edited by curwin, if
* it was changed, we are still the same window and the buffer is