summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/buffer.c121
-rw-r--r--src/charset.c10
-rw-r--r--src/digraph.c4
-rw-r--r--src/edit.c32
-rw-r--r--src/eval.c47
-rw-r--r--src/evalfunc.c59
-rw-r--r--src/ex_cmds.c52
-rw-r--r--src/ex_cmds2.c57
-rw-r--r--src/ex_docmd.c196
-rw-r--r--src/ex_getln.c4
-rw-r--r--src/feature.h20
-rw-r--r--src/fileio.c30
-rw-r--r--src/fold.c3
-rw-r--r--src/getchar.c2
-rw-r--r--src/globals.h31
-rw-r--r--src/gui.c74
-rw-r--r--src/gui.h2
-rw-r--r--src/gui_athena.c2
-rw-r--r--src/gui_beval.c8
-rw-r--r--src/gui_gtk.c2
-rw-r--r--src/gui_motif.c2
-rw-r--r--src/gui_w32.c20
-rw-r--r--src/if_cscope.c10
-rw-r--r--src/if_lua.c4
-rw-r--r--src/if_mzsch.c14
-rw-r--r--src/if_perl.xs18
-rw-r--r--src/if_py_both.h4
-rw-r--r--src/if_python.c2
-rw-r--r--src/if_python3.c2
-rw-r--r--src/if_ruby.c10
-rw-r--r--src/if_tcl.c2
-rw-r--r--src/main.c41
-rw-r--r--src/mark.c8
-rw-r--r--src/memline.c6
-rw-r--r--src/misc1.c15
-rw-r--r--src/misc2.c15
-rw-r--r--src/move.c31
-rw-r--r--src/netbeans.c4
-rw-r--r--src/normal.c51
-rw-r--r--src/option.c147
-rw-r--r--src/option.h20
-rw-r--r--src/popupmnu.c10
-rw-r--r--src/quickfix.c35
-rw-r--r--src/screen.c263
-rw-r--r--src/search.c12
-rw-r--r--src/spell.c2
-rw-r--r--src/structs.h27
-rw-r--r--src/syntax.c8
-rw-r--r--src/tag.c57
-rw-r--r--src/term.c23
-rw-r--r--src/term.h2
-rw-r--r--src/testdir/test_normal.vim2
-rw-r--r--src/ui.c35
-rw-r--r--src/version.c14
-rw-r--r--src/vim.h24
-rw-r--r--src/window.c128
-rw-r--r--src/workshop.c2
57 files changed, 237 insertions, 1589 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 57330bfa14..110dada7a6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -59,7 +59,7 @@ static void clear_wininfo(buf_T *buf);
static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr);
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
static char *msg_loclist = N_("[Location List]");
static char *msg_qflist = N_("[Quickfix List]");
#endif
@@ -458,11 +458,9 @@ close_buffer(
int is_curbuf;
int nwindows;
bufref_T bufref;
-# ifdef FEAT_WINDOWS
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
win_T *the_curwin = curwin;
tabpage_T *the_curtab = curtab;
-# endif
#endif
int unload_buf = (action != 0);
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
@@ -522,11 +520,8 @@ close_buffer(
}
#endif
- if (win != NULL
-#ifdef FEAT_WINDOWS
- && win_valid_any_tab(win) /* in case autocommands closed the window */
-#endif
- )
+ /* check no autocommands closed the window */
+ if (win != NULL && win_valid_any_tab(win))
{
/* Set b_last_cursor when closing the last window for the buffer.
* Remember the last cursor position and window options of the buffer.
@@ -581,7 +576,6 @@ aucmd_abort:
# endif
}
-# ifdef FEAT_WINDOWS
/* If the buffer was in curwin and the window has changed, go back to that
* window, if it still exists. This avoids that ":edit x" triggering a
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
@@ -591,7 +585,6 @@ aucmd_abort:
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
-# endif
nwindows = buf->b_nwindows;
#endif
@@ -650,13 +643,7 @@ aucmd_abort:
if (buf == curbuf && !is_curbuf)
return;
- if (
-#ifdef FEAT_WINDOWS
- win_valid_any_tab(win) &&
-#else
- win != NULL &&
-#endif
- win->w_buffer == buf)
+ if (win_valid_any_tab(win) && win->w_buffer == buf)
win->w_buffer = NULL; /* make sure we don't use the buffer now */
/* Autocommands may have opened or closed windows for this buffer.
@@ -746,11 +733,9 @@ buf_freeall(buf_T *buf, int flags)
#ifdef FEAT_AUTOCMD
int is_curbuf = (buf == curbuf);
bufref_T bufref;
-# ifdef FEAT_WINDOWS
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
win_T *the_curwin = curwin;
tabpage_T *the_curtab = curtab;
-# endif
/* Make sure the buffer isn't closed by autocommands. */
++buf->b_locked;
@@ -781,7 +766,6 @@ buf_freeall(buf_T *buf, int flags)
}
--buf->b_locked;
-# ifdef FEAT_WINDOWS
/* If the buffer was in curwin and the window has changed, go back to that
* window, if it still exists. This avoids that ":edit x" triggering a
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
@@ -791,7 +775,6 @@ buf_freeall(buf_T *buf, int flags)
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
-# endif
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
@@ -818,7 +801,6 @@ buf_freeall(buf_T *buf, int flags)
#ifdef FEAT_FOLDING
/* No folds in an empty buffer. */
-# ifdef FEAT_WINDOWS
{
win_T *win;
tabpage_T *tp;
@@ -827,10 +809,6 @@ buf_freeall(buf_T *buf, int flags)
if (win->w_buffer == buf)
clearFolding(win);
}
-# else
- if (curwin != NULL && curwin->w_buffer == buf)
- clearFolding(curwin);
-# endif
#endif
#ifdef FEAT_TCL
@@ -1001,7 +979,7 @@ goto_buffer(
int dir,
int count)
{
-# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
+# if defined(HAS_SWAP_EXISTS_ACTION)
bufref_T old_curbuf;
set_bufref(&old_curbuf, curbuf);
@@ -1010,7 +988,7 @@ goto_buffer(
# endif
(void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO,
start, dir, count, eap->forceit);
-# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
+# if defined(HAS_SWAP_EXISTS_ACTION)
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
@@ -1269,11 +1247,9 @@ empty_curbuf(
}
set_bufref(&bufref, buf);
-#ifdef FEAT_WINDOWS
if (close_others)
/* Close any other windows on this buffer, then make it empty. */
close_windows(buf, TRUE);
-#endif
setpcmark();
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
@@ -1410,11 +1386,9 @@ do_buffer(
if (unload)
{
int forward;
-# if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS)
bufref_T bufref;
set_bufref(&bufref, buf);
-# endif
/* When unloading or deleting a buffer that's already unloaded and
* unlisted: fail silently. */
@@ -1461,33 +1435,28 @@ do_buffer(
if (bp == NULL && buf == curbuf)
return empty_curbuf(TRUE, forceit, action);
-#ifdef FEAT_WINDOWS
/*
* If the deleted buffer is the current one, close the current window
* (unless it's the only window). Repeat this so long as we end up in
* a window with this buffer.
*/
while (buf == curbuf
-# ifdef FEAT_AUTOCMD
+#ifdef FEAT_AUTOCMD
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
-# endif
+#endif
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
{
if (win_close(curwin, FALSE) == FAIL)
break;
}
-#endif
/*
* If the buffer to be deleted is not the current one, delete it here.
*/
if (buf != curbuf)
{
-#ifdef FEAT_WINDOWS
close_windows(buf, FALSE);
- if (buf != curbuf && bufref_valid(&bufref))
-#endif
- if (buf->b_nwindows <= 0)
+ if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0)
close_buffer(NULL, buf, action, FALSE);
return OK;
}
@@ -1606,7 +1575,6 @@ do_buffer(
*/
if (action == DOBUF_SPLIT) /* split window first */
{
-# ifdef FEAT_WINDOWS
/* If 'switchbuf' contains "useopen": jump to first window containing
* "buf" if one exists */
if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
@@ -1616,7 +1584,6 @@ do_buffer(
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
return OK;
if (win_split(0, 0) == FAIL)
-# endif
return FAIL;
}
#endif
@@ -1719,30 +1686,24 @@ set_curbuf(buf_T *buf, int action)
if (prevbuf == curwin->w_buffer)
reset_synblock(curwin);
#endif
-#ifdef FEAT_WINDOWS
if (unload)
close_windows(prevbuf, FALSE);
-#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (bufref_valid(&bufref) && !aborting())
#else
if (bufref_valid(&bufref))
#endif
{
-#ifdef FEAT_WINDOWS
win_T *previouswin = curwin;
-#endif
if (prevbuf == curbuf)
u_sync(FALSE);
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
unload ? action : (action == DOBUF_GOTO
&& !buf_hide(prevbuf)
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
-#ifdef FEAT_WINDOWS
if (curwin != previouswin && win_valid(previouswin))
/* autocommands changed curwin, Grr! */
curwin = previouswin;
-#endif
}
}
#ifdef FEAT_AUTOCMD
@@ -1751,12 +1712,9 @@ set_curbuf(buf_T *buf, int action)
* If curwin->w_buffer is null, enter_buffer() will make it valid again */
if ((buf_valid(buf) && buf != curbuf
# ifdef FEAT_EVAL
- && !aborting()
-# endif
-# ifdef FEAT_WINDOWS
- ) || curwin->w_buffer == NULL
+ && !aborting()
# endif
- )
+ ) || curwin->w_buffer == NULL)
#endif
{
enter_buffer(buf);
@@ -2327,9 +2285,7 @@ buflist_getfile(
int forceit)
{
buf_T *buf;
-#ifdef FEAT_WINDOWS
win_T *wp = NULL;
-#endif
pos_T *fpos;
colnr_T col;
@@ -2367,7 +2323,6 @@ buflist_getfile(
else
col = 0;
-#ifdef FEAT_WINDOWS
if (options & GETF_SWITCH)
{
/* If 'switchbuf' contains "useopen": jump to first window containing
@@ -2393,7 +2348,6 @@ buflist_getfile(
RESET_BINDING(curwin);
}
}
-#endif
++RedrawingDisabled;
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
@@ -2598,7 +2552,6 @@ buflist_findpat(
{
/* Ignore the match if the buffer is not open in
* the current tab. */
-#ifdef FEAT_WINDOWS
win_T *wp;
FOR_ALL_WINDOWS(wp)
@@ -2606,10 +2559,6 @@ buflist_findpat(
break;
if (wp == NULL)
continue;
-#else
- if (curwin->w_buffer != buf)
- continue;
-#endif
}
if (match >= 0) /* already found a match */
{
@@ -3089,7 +3038,10 @@ buflist_list(exarg_T *eap)
#ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
{
- ro_char = 'R';
+ if (term_none_open(buf->b_term))
+ ro_char = '?';
+ else
+ ro_char = 'R';
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
* closing, but it's not actually changed. */
}
@@ -3292,9 +3244,7 @@ buf_name_changed(buf_T *buf)
#ifdef FEAT_TITLE
maketitle(); /* set window title */
#endif
-#ifdef FEAT_WINDOWS
status_redraw_all(); /* status lines need to be redrawn */
-#endif
fmarks_check_names(buf); /* check named file marks */
ml_timestamp(buf); /* reset timestamp */
}
@@ -4422,7 +4372,7 @@ build_stl_str_hl(
break;
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
case STL_PREVIEWFLAG:
case STL_PREVIEWFLAG_ALT:
itemisflag = TRUE;
@@ -4908,7 +4858,6 @@ alist_name(aentry_T *aep)
return bp->b_fname;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* do_arg_all(): Open up to 'count' windows, one for each argument.
*/
@@ -5057,23 +5006,19 @@ do_arg_all(
}
#endif
}
-#ifdef FEAT_WINDOWS
/* don't close last window */
if (ONE_WINDOW
&& (first_tabpage->tp_next == NULL || !had_tab))
-#endif
use_firstwin = TRUE;
-#ifdef FEAT_WINDOWS
else
{
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
-# ifdef FEAT_AUTOCMD
+#ifdef FEAT_AUTOCMD
/* check if autocommands removed the next window */
if (!win_valid(wpnext))
wpnext = firstwin; /* start all over... */
-# endif
- }
#endif
+ }
}
}
}
@@ -5105,13 +5050,11 @@ do_arg_all(
last_curwin = curwin;
last_curtab = curtab;
win_enter(lastwin, FALSE);
-#ifdef FEAT_WINDOWS
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
* leaving an empty tab page when executed locally. */
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
use_firstwin = TRUE;
-#endif
for (i = 0; i < count && i < opened_len && !got_int; ++i)
{
@@ -5222,10 +5165,8 @@ ex_buffer_all(exarg_T *eap)
int r;
int count; /* Maximum number of windows to open. */
int all; /* When TRUE also load inactive buffers. */
-#ifdef FEAT_WINDOWS
int had_tab = cmdmod.tab;
tabpage_T *tpnext;
-#endif
if (eap->addr_count == 0) /* make as many windows as possible */
count = 9999;
@@ -5246,25 +5187,20 @@ ex_buffer_all(exarg_T *eap)
* Close superfluous windows (two windows for the same buffer).
* Also close windows that are not full-width.
*/
-#ifdef FEAT_WINDOWS
if (had_tab > 0)
goto_tabpage_tp(first_tabpage, TRUE, TRUE);
for (;;)
{
-#endif
tpnext = curtab->tp_next;
for (wp = firstwin; wp != NULL; wp = wpnext)
{
wpnext = wp->w_next;
if ((wp->w_buffer->b_nwindows > 1
-#ifdef FEAT_WINDOWS
|| ((cmdmod.split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
- || (had_tab > 0 && wp != firstwin)
-#endif
- ) && !ONE_WINDOW
+ || (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
#ifdef FEAT_AUTOCMD
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
#endif
@@ -5282,13 +5218,11 @@ ex_buffer_all(exarg_T *eap)
++open_wins;
}
-#ifdef FEAT_WINDOWS
/* Without the ":tab" modifier only do the current tab page. */
if (had_tab == 0 || tpnext == NULL)
break;
goto_tabpage_tp(tpnext, TRUE, TRUE);
}
-#endif
/*
* Go through the buffer list. When a buffer doesn't have a window yet,
@@ -5309,7 +5243,6 @@ ex_buffer_all(exarg_T *eap)
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
continue;
-#ifdef FEAT_WINDOWS
if (had_tab != 0)
{
/* With the ":tab" modifier don't move the window. */
@@ -5319,7 +5252,6 @@ ex_buffer_all(exarg_T *eap)
wp = NULL;
}
else
-#endif
{
/* Check if this buffer already has a window */
FOR_ALL_WINDOWS(wp)
@@ -5401,11 +5333,9 @@ ex_buffer_all(exarg_T *eap)
if (aborting())
break;
#endif
-#ifdef FEAT_WINDOWS
/* When ":tab" was used open a new tab for a new window repeatedly. */
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
cmdmod.tab = 9999;
-#endif
}
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
@@ -5446,7 +5376,6 @@ ex_buffer_all(exarg_T *eap)
}
# endif /* FEAT_LISTCMDS */
-#endif /* FEAT_WINDOWS */
static int chk_modeline(linenr_T, int);
@@ -5673,10 +5602,8 @@ read_viminfo_bufferlist(
write_viminfo_bufferlist(FILE *fp)
{
buf_T *buf;
-#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
-#endif
char_u *line;
int max_buffers;
@@ -5692,12 +5619,8 @@ write_viminfo_bufferlist(FILE *fp)
if (line == NULL)
return;
-#ifdef FEAT_WINDOWS
FOR_ALL_TAB_WINDOWS(tp, win)
set_last_cursor(win);
-#else
- set_last_cursor(curwin);
-#endif
fputs(_("\n# Buffer list:\n"), fp);
FOR_ALL_BUFFERS(buf)
@@ -5810,7 +5733,7 @@ buf_hide(buf_T *buf)
char_u *
buf_spname(buf_T *buf)
{
-#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+#if defined(FEAT_QUICKFIX)
if (bt_quickfix(buf))
{
win_T *win;
@@ -5888,9 +5811,7 @@ restore_win_for_buf(
}
#endif
-#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
- || defined(SWITCH_TO_WIN) \
- || defined(PROTO)
+#if defined(FEAT_QUICKFIX) || defined(SWITCH_TO_WIN) || defined(PROTO)
/*
* Find a window for buffer "buf".
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
diff --git a/src/charset.c b/src/charset.c
index 8b83f68068..4f79c90aac 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -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.
diff --git a/src/digraph.c b/src/digraph.c
index 5e092c36f7..0b78af7451 100644
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -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 */
diff --git a/src/edit.c b/src/edit.c
index 6fd1245390..447e2ee29e 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1360,7 +1360,7 @@ doESCkey:
/* 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)<