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
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);
}
#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.
# 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. */
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
-# endif
nwindows = buf->b_nwindows;
#endif
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.
#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;
}
--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. */
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
-# endif
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
#ifdef FEAT_FOLDING
/* No folds in an empty buffer. */
-# ifdef FEAT_WINDOWS
{
win_T *win;
tabpage_T *tp;
if (win->w_buffer == buf)
clearFolding(win);
}
-# else
- if (curwin != NULL && curwin->w_buffer == buf)
- clearFolding(curwin);
-# endif
#endif
#ifdef FEAT_TCL
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);
# 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)
}
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,
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. */
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;
}
*/
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))
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
return OK;
if (win_split(0, 0) == FAIL)
-# endif
return FAIL;
}
#endif
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
* 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);
int forceit)
{
buf_T *buf;
-#ifdef FEAT_WINDOWS
win_T *wp = NULL;
-#endif
pos_T *fpos;
colnr_T col;
else
col = 0;
-#ifdef FEAT_WINDOWS
if (options & GETF_SWITCH)
{
/* If 'switchbuf' contains "useopen": jump to first window containing
RESET_BINDING(curwin);
}
}
-#endif
++RedrawingDisabled;
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
{
/* Ignore the match if the buffer is not open in
* the current tab. */
-#ifdef FEAT_WINDOWS
win_T *wp;
FOR_ALL_WINDOWS(wp)
break;
if (wp == NULL)
continue;
-#else
- if (curwin->w_buffer != buf)
- continue;
-#endif
}
if (match >= 0) /* already found a match */
{
#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. */
}
#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 */
}
break;
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
case STL_PREVIEWFLAG:
case STL_PREVIEWFLAG_ALT:
itemisflag = TRUE;
return bp->b_fname;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* do_arg_all(): Open up to 'count' windows, one for each argument.
*/
}
#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
+ }
}
}
}
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)
{
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;
* 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
++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,
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. */
wp = NULL;
}
else
-#endif
{
/* Check if this buffer already has a window */
FOR_ALL_WINDOWS(wp)
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;
}
# endif /* FEAT_LISTCMDS */
-#endif /* FEAT_WINDOWS */
static int chk_modeline(linenr_T, int);
write_viminfo_bufferlist(FILE *fp)
{
buf_T *buf;
-#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
-#endif
char_u *line;
int max_buffers;
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)
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;
}
#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.
&& 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
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;
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.
p_cpo = save_cpo;
curbuf->b_kmap_state |= KEYMAP_LOADED;
-#ifdef FEAT_WINDOWS
status_redraw_curbuf();
-#endif
}
/*
ga_clear(&curbuf->b_kmap_ga);
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
-#ifdef FEAT_WINDOWS
status_redraw_curbuf();
-#endif
}
#endif /* FEAT_KEYMAP */
/* 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)
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'
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
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))
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;
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)
# 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.
undisplay_dollar();
-#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageUp>: tab page back */
}
return;
}
-#endif
tpos = curwin->w_cursor;
if (onepage(BACKWARD, 1L) == OK)
undisplay_dollar();
-#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageDown>: tab page forward */
}
return;
}
-#endif
tpos = curwin->w_cursor;
if (onepage(FORWARD, 1L) == OK)
static void list_glob_vars(int *first);
static void list_buf_vars(int *first);
static void list_win_vars(int *first);
-#ifdef FEAT_WINDOWS
static void list_tab_vars(int *first);
-#endif
static void list_vim_vars(int *first);
static void list_script_vars(int *first);
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
list_glob_vars(&first);
list_buf_vars(&first);
list_win_vars(&first);
-#ifdef FEAT_WINDOWS
list_tab_vars(&first);
-#endif
list_script_vars(&first);
list_func_vars(&first);
list_vim_vars(&first);
(char_u *)"w:", TRUE, first);
}
-#ifdef FEAT_WINDOWS
/*
* List tab page variables.
*/
list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
(char_u *)"t:", TRUE, first);
}
-#endif
/*
* List Vim variables.
case 'g': list_glob_vars(first); break;
case 'b': list_buf_vars(first); break;
case 'w': list_win_vars(first); break;
-#ifdef FEAT_WINDOWS
case 't': list_tab_vars(first); break;
-#endif
case 'v': list_vim_vars(first); break;
case 's': list_script_vars(first); break;
case 'l': list_func_vars(first); break;
static long_u gdone;
static long_u bdone;
static long_u wdone;
-#ifdef FEAT_WINDOWS
static long_u tdone;
-#endif
static int vidx;
static hashitem_T *hi;
hashtab_T *ht;
if (idx == 0)
{
gdone = bdone = wdone = vidx = 0;
-#ifdef FEAT_WINDOWS
tdone = 0;
-#endif
}
/* Global variables */
return cat_prefix_varname('w', hi->hi_key);
}
-#ifdef FEAT_WINDOWS
/* t: variables */
ht = &curtab->tp_vars->dv_hashtab;
if (tdone < ht->ht_used)
++hi;
return cat_prefix_varname('t', hi->hi_key);
}
-#endif
/* v: variables */
if (vidx < VV_LEN)
win_T *wp;
int i;
int did_free = FALSE;
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
-#endif
if (!testing)
{
NULL, NULL);
#endif
-#ifdef FEAT_WINDOWS
/* tabpage-local variables */
FOR_ALL_TABPAGES(tp)
abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID,
NULL, NULL);
-#endif
-
/* global variables */
abort = abort || set_ref_in_ht(&globvarht, copyID, NULL);
case 'v': return &vimvars_var;
case 'b': return &curbuf->b_bufvar;
case 'w': return &curwin->w_winvar;
-#ifdef FEAT_WINDOWS
case 't': return &curtab->tp_winvar;
-#endif
case 'l': return get_funccal_local_var();
case 'a': return get_funccal_args_var();
}
return &curbuf->b_vars->dv_hashtab;
if (*name == 'w') /* window variable */
return &curwin->w_vars->dv_hashtab;
-#ifdef FEAT_WINDOWS
if (*name == 't') /* tab page variable */
return &curtab->tp_vars->dv_hashtab;
-#endif
if (*name == 'v') /* v: variable */
return &vimvarht;
if (*name == 'a') /* a: function argument */
typval_T *vp,
tabpage_T *tp UNUSED) /* NULL for current tab page */
{
-#ifdef FEAT_WINDOWS
win_T *wp;
-#endif
int nr;
nr = (int)get_tv_number_chk(vp, NULL);
-#ifdef FEAT_WINDOWS
if (nr < 0)
return NULL;
if (nr == 0)
if (nr >= LOWEST_WIN_ID)
return NULL;
return wp;
-#else
- if (nr == 0 || nr == 1 || nr == curwin->w_id)
- return curwin;
- return NULL;
-#endif
}
/*
dictitem_T *v;
tabpage_T *tp = NULL;
int done = FALSE;
-#ifdef FEAT_WINDOWS
win_T *oldcurwin;
tabpage_T *oldtabpage;
int need_switch_win;
-#endif
-#ifdef FEAT_WINDOWS
if (off == 1)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
else
tp = curtab;
-#endif
win = find_win_by_nr(&argvars[off], tp);
varname = get_tv_string_chk(&argvars[off + 1]);
++emsg_off;
if (win != NULL && varname != NULL)
{
-#ifdef FEAT_WINDOWS
/* Set curwin to be our win, temporarily. Also set the tabpage,
* otherwise the window is not valid. Only do this when needed,
* autocommands get blocked. */
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
-#endif
{
if (*varname == '&')
{
}
}
-#ifdef FEAT_WINDOWS
if (need_switch_win)
/* restore previous notion of curwin */
restore_win(oldcurwin, oldtabpage, TRUE);
-#endif
}
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
{
win_T *win;
-#ifdef FEAT_WINDOWS
win_T *save_curwin;
tabpage_T *save_curtab;
int need_switch_win;
-#endif
char_u *varname, *winvarname;
typval_T *varp;
char_u nbuf[NUMBUFLEN];
if (check_restricted() || check_secure())
return;
-#ifdef FEAT_WINDOWS
if (off == 1)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
else
tp = curtab;
-#endif
win = find_win_by_nr(&argvars[off], tp);
varname = get_tv_string_chk(&argvars[off + 1]);
varp = &argvars[off + 2];
if (win != NULL && varname != NULL && varp != NULL)
{
-#ifdef FEAT_WINDOWS
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
-#endif
{
if (*varname == '&')
{
}
}
}
-#ifdef FEAT_WINDOWS
if (need_switch_win)
restore_win(save_curwin, save_curtab, TRUE);
-#endif
}
}
static void
buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
{
-#ifdef FEAT_WINDOWS
win_T *wp;
int winnr = 0;
-#endif
buf_T *buf;
(void)get_tv_number(&argvars[0]); /* issue errmsg if type error */
++emsg_off;
buf = get_buf_tv(&argvars[0], TRUE);
-#ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(wp)
{
++winnr;
break;
}
rettv->vval.v_number = (wp != NULL ? (get_nr ? winnr : wp->w_id) : -1);
-#else
- rettv->vval.v_number = (curwin->w_buffer == buf
- ? (get_nr ? 1 : curwin->w_id) : -1);
-#endif
--emsg_off;
}
int col = mouse_col;
win_T *win;
linenr_T lnum;
-# ifdef FEAT_WINDOWS
win_T *wp;
-# endif
int winnr = 1;
if (row >= 0 && col >= 0)
if (win == NULL)
return;
(void)mouse_comp_pos(win, &row, &col, &lnum);
-# ifdef FEAT_WINDOWS
for (wp = firstwin; wp != win; wp = wp->w_next)
++winnr;
-# endif
set_vim_var_nr(VV_MOUSE_WIN, winnr);
set_vim_var_nr(VV_MOUSE_WINID, win->w_id);
set_vim_var_nr(VV_MOUSE_LNUM, lnum);
rettv->vval.v_string = vim_strsave(buf);
}
-#ifdef FEAT_WINDOWS
/*
* Returns information (variables, options, etc.) about a tab page
* as a dictionary.
return dict;
}
-#endif
/*
* "gettabinfo()" function
static void
f_gettabinfo(typval_T *argvars, typval_T *rettv)
{
-#ifdef FEAT_WINDOWS
tabpage_T *tp, *tparg = NULL;
dict_T *d;
int tpnr = 0;
if (tparg != NULL)
return;
}
-#endif
}
/*
getwinvar(argvars, rettv, 1);
}
-#ifdef FEAT_WINDOWS
/*
* Returns information about a window as a dictionary.
*/
return dict;
}
-#endif
/*
* "getwininfo()" function
static void
f_getwininfo(typval_T *argvars, typval_T *rettv)
{
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp = NULL, *wparg = NULL;
dict_T *d;
short tabnr = 0, winnr;
-#endif
if (rettv_list_alloc(rettv) != OK)
return;
-#ifdef FEAT_WINDOWS
if (argvars[0].v_type != VAR_UNKNOWN)
{
wparg = win_id2wp(argvars);
return;
}
}
-#endif
}
/*
#ifdef FEAT_VIMINFO
"viminfo",
#endif
-#ifdef FEAT_WINDOWS
"vertsplit",
-#endif
#ifdef FEAT_VIRTUALEDIT
"virtualedit",
#endif
#ifdef FEAT_WILDMENU
"wildmenu",
#endif
-#ifdef FEAT_WINDOWS
"windows",
-#endif
#ifdef FEAT_WAK
"winaltkeys",
#endif
static void
f_settabvar(typval_T *argvars, typval_T *rettv)
{
-#ifdef FEAT_WINDOWS
tabpage_T *save_curtab;
tabpage_T *tp;
-#endif
char_u *varname, *tabvarname;
typval_T *varp;
if (check_restricted() || check_secure())
return;
-#ifdef FEAT_WINDOWS
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
-#endif
varname = get_tv_string_chk(&argvars[1]);
varp = &argvars[2];
- if (varname != NULL && varp != NULL
-#ifdef FEAT_WINDOWS
- && tp != NULL
-#endif
- )
+ if (varname != NULL && varp != NULL && tp != NULL)
{
-#ifdef FEAT_WINDOWS
save_curtab = curtab;
goto_tabpage_tp(tp, FALSE, FALSE);
-#endif
tabvarname = alloc((unsigned)STRLEN(varname) + 3);
if (tabvarname != NULL)
vim_free(tabvarname);
}
-#ifdef FEAT_WINDOWS
/* Restore current tabpage */
if (valid_tabpage(save_curtab))
goto_tabpage_tp(save_curtab, FALSE, FALSE);
-#endif
}
}
static void
f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp = NULL;
wp->w_buffer->b_fnum) == FAIL)
break;
}
-#endif
}
f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
-#ifdef FEAT_WINDOWS
char_u *arg;
if (argvars[0].v_type != VAR_UNKNOWN)
}
else
nr = tabpage_index(curtab);
-#endif
rettv->vval.v_number = nr;
}
-#ifdef FEAT_WINDOWS
static int get_winnr(tabpage_T *tp, typval_T *argvar);
/*
}
return nr;
}
-#endif
/*
* "tabpagewinnr()" function
f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
tp = find_tabpage((int)get_tv_number(&argvars[0]));
nr = 0;
else
nr = get_winnr(tp, &argvars[1]);
-#endif
rettv->vval.v_number = nr;
}
{
int nr = 1;
-#ifdef FEAT_WINDOWS
nr = get_winnr(curtab, &argvars[0]);
-#endif
rettv->vval.v_number = nr;
}
static void
f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
{
-#ifdef FEAT_WINDOWS
win_T *wp;
int winnr = 1;
garray_T ga;
ga_append(&ga, NUL);
rettv->vval.v_string = ga.ga_data;
-#else
- rettv->vval.v_string = NULL;
-#endif
rettv->v_type = VAR_STRING;
}
check_cursor();
win_new_height(curwin, curwin->w_height);
-# ifdef FEAT_WINDOWS
win_new_width(curwin, W_WIDTH(curwin));
-# endif
changed_window_setting();
if (curwin->w_topline <= 0)
if (wp == NULL)
rettv->vval.v_number = -1;
else
-#ifdef FEAT_WINDOWS
rettv->vval.v_number = wp->w_width;
-#else
- rettv->vval.v_number = Columns;
-#endif
}
/*
if (retval == OK)
{
curbuf->b_p_ro = FALSE;
-#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
-#endif
}
}
#ifdef FEAT_FOLDING
/* It's possible that all lines in the buffer changed. Need to update
* automatic folding for all windows where it's used. */
-# ifdef FEAT_WINDOWS
{
win_T *win;
tabpage_T *tp;
if (win->w_buffer == curbuf)
foldUpdateAll(win);
}
-# else
- foldUpdateAll(curwin);
-# endif
#endif
/* Change directories when the 'acd' option is set. */
}
}
-#ifdef FEAT_WINDOWS
/* Check if cursors in other windows on the same buffer are still valid */
check_lnums(FALSE);
-#endif
/*
* Did not read the file, need to show some info about the file.
* 'scroll' */
if (eap->forceit)
bigness = curwin->w_height;
-#ifdef FEAT_WINDOWS
else if (!ONE_WINDOW)
bigness = curwin->w_height - 3;
-#endif
else
bigness = curwin->w_p_scr * 2;
if (bigness < 1)
}
#endif
-#if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO)
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Set up for a tagpreview.
* Return TRUE when it was created.
FILE *helpfd; /* file descriptor of help file */
int n;
int i;
-#ifdef FEAT_WINDOWS
win_T *wp;
-#endif
int num_matches;
char_u **matches;
char_u *p;
* Re-use an existing help window or open a new one.
* Always open a new one for ":tab help".
*/
- if (!bt_help(curwin->w_buffer)
-#ifdef FEAT_WINDOWS
- || cmdmod.tab != 0
-#endif
- )
+ if (!bt_help(curwin->w_buffer) || cmdmod.tab != 0)
{
-#ifdef FEAT_WINDOWS
if (cmdmod.tab != 0)
wp = NULL;
else
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
win_enter(wp, TRUE);
else
-#endif
{
/*
* There is no help window yet.
}
fclose(helpfd);
-#ifdef FEAT_WINDOWS
/* Split off help window; put it at far top if no position
* specified, the current window is vertically split and
* narrow. */
n |= WSP_TOP;
if (win_split(0, n) == FAIL)
goto erret;
-#else
- /* use current window */
- if (!can_abandon(curbuf, FALSE))
- goto erret;
-#endif
-#ifdef FEAT_WINDOWS
if (curwin->w_height < p_hh)
win_setheight((int)p_hh);
-#endif
/*
* Open help file (do_ecmd() will set b_help flag, readfile() will
alt_fnum = curbuf->b_fnum;
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
ECMD_HIDE + ECMD_SET_HELP,
-#ifdef FEAT_WINDOWS
- NULL /* buffer is still open, don't store info */
-#else
- curwin
-#endif
- );
+ NULL); /* buffer is still open, don't store info */
if (!cmdmod.keepalt)
curwin->w_alt_fnum = alt_fnum;
empty_fnum = curbuf->b_fnum;
void
ex_helpclose(exarg_T *eap UNUSED)
{
-#if defined(FEAT_WINDOWS)
win_T *win;
FOR_ALL_WINDOWS(win)
return;
}
}
-#endif
}
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
int split = FALSE;
win_T *wp;
buf_T *buf;
-# ifdef FEAT_WINDOWS
tabpage_T *tp;
-# endif
/*
* Check if the first argument is already being edited in a window. If
if (ARGCOUNT == 0)
return;
-# ifdef FEAT_WINDOWS
if (cmdmod.tab)
{
/* ":tab drop file ...": open a tab for each argument that isn't
ex_all(eap);
}
else
-# endif
{
/* ":drop file ...": Edit the first argument. Jump to an existing
* window if possible, edit in current window if the current buffer
{
if (wp->w_buffer == buf)
{
-# ifdef FEAT_WINDOWS
goto_tabpage_win(tp, wp);
-# endif
curwin->w_arg_idx = 0;
return;
}
*/
if (!buf_hide(curbuf))
{
-# ifdef FEAT_WINDOWS
++emsg_off;
-# endif
split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD);
-# ifdef FEAT_WINDOWS
--emsg_off;
-# else
- if (split)
- return;
-# endif
}
/* Fake a ":sfirst" or ":first" command edit the first argument. */
int bufnum = 0;
int bufcount = 0;
int *bufnrs;
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp;
-#endif
FOR_ALL_BUFFERS(buf)
++bufcount;
/* curbuf */
bufnrs[bufnum++] = curbuf->b_fnum;
-#ifdef FEAT_WINDOWS
/* buf in curtab */
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer != curbuf)
if (tp != curtab)
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
-#endif
/* any other buf */
FOR_ALL_BUFFERS(buf)
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
}
}
-#ifdef FEAT_WINDOWS
/* Try to find a window that contains the buffer. */
if (buf != curbuf)
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
{
-# ifdef FEAT_AUTOCMD
+#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
-# endif
+#endif
goto_tabpage_win(tp, wp);
-# ifdef FEAT_AUTOCMD
+#ifdef FEAT_AUTOCMD
/* Paranoia: did autocms wipe out the buffer with changes? */
if (!bufref_valid(&bufref))
{
goto theend;
}
-# endif
+#endif
goto buf_found;
}
buf_found:
-#endif
/* Open the changed buffer in the current window. */
if (buf != curbuf)
static void
alist_check_arg_idx(void)
{
-#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, win)
if (win->w_alist == curwin->w_alist)
check_arg_idx(win);
-#else
- check_arg_idx(curwin);
-#endif
}
/*
win->w_arg_idx_invalid = TRUE;
if (win->w_arg_idx != WARGCOUNT(win) - 1
&& arg_had_last == FALSE
-#ifdef FEAT_WINDOWS
&& ALIST(win) == &global_alist
-#endif
&& GARGCOUNT > 0
&& win->w_arg_idx < GARGCOUNT
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
* Set "arg_had_last" if it's also the last one */
win->w_arg_idx_invalid = FALSE;
if (win->w_arg_idx == WARGCOUNT(win) - 1
-#ifdef FEAT_WINDOWS
- && win->w_alist == &global_alist
-#endif
- )
+ && win->w_alist == &global_alist)
arg_had_last = TRUE;
}
}
if (eap->cmdidx != CMD_args)
{
-#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+#if defined(FEAT_LISTCMDS)
alist_unlink(ALIST(curwin));
if (eap->cmdidx == CMD_argglobal)
ALIST(curwin) = &global_alist;
ex_next(eap);
}
else
-#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+#if defined(FEAT_LISTCMDS)
if (eap->cmdidx == CMD_args)
#endif
{
}
}
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+#if defined(FEAT_LISTCMDS)
else if (eap->cmdidx == CMD_arglocal)
{
garray_T *gap = &curwin->w_alist->al_ga;
need_mouse_correct = TRUE;
#endif
-#ifdef FEAT_WINDOWS
/* split window or create new tab page first */
if (*eap->cmd == 's' || cmdmod.tab != 0)
{
RESET_BINDING(curwin);
}
else
-#endif
{
/*
* if 'hidden' set, only check for changed file when re-editing
}
curwin->w_arg_idx = argn;
- if (argn == ARGCOUNT - 1
-#ifdef FEAT_WINDOWS
- && curwin->w_alist == &global_alist
-#endif
- )
+ if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist)
arg_had_last = TRUE;
/* Edit the file; always use the last known line number.
ex_listdo(exarg_T *eap)
{
int i;
-#ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
-#endif
buf_T *buf = curbuf;
int next_fnum = 0;
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
int qf_idx;
#endif
-#ifndef FEAT_WINDOWS
- if (eap->cmdidx == CMD_windo)
- {
- ex_ni(eap);
- return;
- }
-#endif
-
#ifndef FEAT_QUICKFIX
if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo)
{
i = 0;
/* start at the eap->line1 argument/window/buffer */
-#ifdef FEAT_WINDOWS
wp = firstwin;
tp = first_tabpage;
-#endif
switch (eap->cmdidx)
{
-#ifdef FEAT_WINDOWS
case CMD_windo:
for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
i++;
for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
i++;
break;
-#endif
case CMD_argdo:
i = eap->line1 - 1;
break;
if (curwin->w_arg_idx != i)
break;
}
-#ifdef FEAT_WINDOWS
else if (eap->cmdidx == CMD_windo)
{
/* go to window "wp" */
goto_tabpage_tp(tp, TRUE, TRUE);
tp = tp->tp_next;
}
-#endif
else if (eap->cmdidx == CMD_bufdo)
{
/* Remember the number of the next listed buffer, in case
#endif
}
-#ifdef FEAT_WINDOWS
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
if (i+1 > eap->line2)
break;
-#endif
if (eap->cmdidx == CMD_argdo && i >= eap->line2)
break;
}
# define buflist_list ex_ni
# define ex_checktime ex_ni
#endif
-#if !defined(FEAT_LISTCMDS) || !defined(FEAT_WINDOWS)
+#if !defined(FEAT_LISTCMDS)
# define ex_buffer_all ex_ni
#endif
static char_u *getargcmd(char_u **);
# define ex_helpgrep ex_ni
# define ex_vimgrep ex_ni
#endif
-#if !defined(FEAT_QUICKFIX) || !defined(FEAT_WINDOWS)
+#if !defined(FEAT_QUICKFIX)
# define ex_cclose ex_ni
# define ex_copen ex_ni
# define ex_cwindow ex_ni
static void ex_quit(exarg_T *eap);
static void ex_cquit(exarg_T *eap);
static void ex_quit_all(exarg_T *eap);
-#ifdef FEAT_WINDOWS
static void ex_close(exarg_T *eap);
static void ex_win_close(int forceit, win_T *win, tabpage_T *tp);
static void ex_only(exarg_T *eap);
static void ex_tabnext(exarg_T *eap);
static void ex_tabmove(exarg_T *eap);
static void ex_tabs(exarg_T *eap);
-#else
-# define ex_close ex_ni
-# define ex_only ex_ni
-# define ex_all ex_ni
-# define ex_resize ex_ni
-# define ex_splitview ex_ni
-# define ex_stag ex_ni
-# define ex_tabnext ex_ni
-# define ex_tabmove ex_ni
-# define ex_tabs ex_ni
-# define ex_tabclose ex_ni
-# define ex_tabonly ex_ni
-#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
static void ex_pclose(exarg_T *eap);
static void ex_ptag(exarg_T *eap);
static void ex_pedit(exarg_T *eap);
static void ex_sleep(exarg_T *eap);
static void do_exmap(exarg_T *eap, int isabbrev);
static void ex_winsize(exarg_T *eap);
-#ifdef FEAT_WINDOWS
static void ex_wincmd(exarg_T *eap);
-#else
-# define ex_wincmd ex_ni
-#endif
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
static void ex_winpos(exarg_T *eap);
#else
# define ex_findpat ex_ni
# define ex_checkpath ex_ni
#endif
-#if defined(FEAT_FIND_ID) && defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_FIND_ID) && defined(FEAT_QUICKFIX)
static void ex_psearch(exarg_T *eap);
#else
# define ex_psearch ex_ni
return buf->b_fnum;
}
-#ifdef FEAT_WINDOWS
static int current_win_nr(win_T *win);
static int current_tab_nr(tabpage_T *tab);
# define LAST_WIN_NR current_win_nr(NULL)
# define CURRENT_TAB_NR current_tab_nr(curtab)
# define LAST_TAB_NR current_tab_nr(NULL)
-#else
-# define CURRENT_WIN_NR 1
-# define LAST_WIN_NR 1
-# define CURRENT_TAB_NR 1
-# define LAST_TAB_NR 1
-#endif
-
/*
* Execute one Ex command.
/* When adding an entry, also modify cmd_exists(). */
case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
break;
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_ABOVE;
-#endif
continue;
case 'b': if (checkforcmd(&ea.cmd, "belowright", 3))
{
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BELOW;
-#endif
continue;
}
if (checkforcmd(&ea.cmd, "browse", 3))
}
if (!checkforcmd(&ea.cmd, "botright", 2))
break;
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BOT;
-#endif
continue;
case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4))
if (!checkforcmd(&ea.cmd, "leftabove", 5))
break;
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_ABOVE;
-#endif
continue;
case 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3))
case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
break;
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BELOW;
-#endif
continue;
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3))
case 't': if (checkforcmd(&p, "tab", 3))
{
-#ifdef FEAT_WINDOWS
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
ea.skip, FALSE, 1);
if (tabnr == MAXLNUM)
cmdmod.tab = tabnr + 1;
}
ea.cmd = p;
-#endif
continue;
}
if (!checkforcmd(&ea.cmd, "topleft", 2))
break;
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_TOP;
-#endif
continue;
case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
{
-#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_VERT;
-#endif
continue;
}
if (!checkforcmd(&p, "verbose", 4))
else
ea.addr_type = ADDR_LINES;
-#ifdef FEAT_WINDOWS
/* :wincmd range depends on the argument. */
if (ea.cmdidx == CMD_wincmd && p != NULL)
get_wincmd_addr_type(skipwhite(p), &ea);
-#endif
}
/* repeat for all ',' or ';' separated addresses */
*buf = '\0';
}
-#ifdef FEAT_WINDOWS
/* :aboveleft and :leftabove */
if (cmdmod.split & WSP_ABOVE)
result += add_cmd_modifier(buf, "aboveleft", &multi_mods);
/* :botright */
if (cmdmod.split & WSP_BOT)
result += add_cmd_modifier(buf, "botright", &multi_mods);
-#endif
/* the modifiers that are simple flags */
for (i = 0; mod_entries[i].varp != NULL; ++i)
if (msg_silent > 0)
result += add_cmd_modifier(buf,
emsg_silent > 0 ? "silent!" : "silent", &multi_mods);
-#ifdef FEAT_WINDOWS
/* :tab */
if (cmdmod.tab > 0)
result += add_cmd_modifier(buf, "tab", &multi_mods);
/* :topleft */
if (cmdmod.split & WSP_TOP)
result += add_cmd_modifier(buf, "topleft", &multi_mods);
-#endif
/* TODO: How to support :unsilent?*/
/* :verbose */
if (p_verbose > 0)
result += add_cmd_modifier(buf, "verbose", &multi_mods);
-#ifdef FEAT_WINDOWS
/* :vertical */
if (cmdmod.split & WSP_VERT)
result += add_cmd_modifier(buf, "vertical", &multi_mods);
-#endif
if (quote && buf != NULL)
{
buf += result - 2;
static void
ex_quit(exarg_T *eap)
{
-#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
win_T *wp;
-#endif
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
text_locked_msg();
return;
}
-#ifdef FEAT_WINDOWS
if (eap->addr_count > 0)
{
int wnr = eap->line2;
break;
}
else
-#endif
-#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
wp = curwin;
-#endif
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
- if (curbuf_locked()
-# ifdef FEAT_WINDOWS
- || !win_valid(wp)
-# endif
+ if (curbuf_locked() || !win_valid(wp)
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
return;
#endif
}
else
{
-#ifdef FEAT_WINDOWS
/* quit last window
* Note: only_one_window() returns true, even so a help window is
* still open. In that case only quit, if no address has been
* :h|wincmd w|q - quit
*/
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0))
-#endif
getout(0);
-#ifdef FEAT_WINDOWS
-# ifdef FEAT_GUI
+#ifdef FEAT_GUI
need_mouse_correct = TRUE;
-# endif
+#endif
/* close window; may free buffer */
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
-#endif
}
}
not_exiting();
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* ":close": close current window, unless it is the last one
*/
{
win_T *win;
int winnr = 0;
-# ifdef FEAT_CMDWIN
+#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = Ctrl_C;
else
-# endif
+#endif
if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
}
}
-# ifdef FEAT_QUICKFIX
+#ifdef FEAT_QUICKFIX
/*
* ":pclose": Close any preview window.
*/
break;
}
}
-# endif
+#endif
/*
* Close window "win" and take care of handling closing the last window for a
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
if (need_hide && !buf_hide(buf) && !forceit)
{
-# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
{
bufref_T bufref;
need_hide = FALSE;
}
else
-# endif
+#endif
{
no_write_message();
return;
}
}
-# ifdef FEAT_GUI
+#ifdef FEAT_GUI
need_mouse_correct = TRUE;
-# endif
+#endif
/* free buffer when not hiding it or when it's a scratch buffer */
if (tp == NULL)
eap->line2 = 9999;
do_arg_all((int)eap->line2, eap->forceit, eap->cmdidx == CMD_drop);
}
-#endif /* FEAT_WINDOWS */
static void
ex_hide(exarg_T *eap UNUSED)
{
/* ":hide" or ":hide | cmd": hide current window */
-#ifdef FEAT_WINDOWS
if (!eap->skip)
{
-# ifdef FEAT_GUI
+#ifdef FEAT_GUI
need_mouse_correct = TRUE;
-# endif
+#endif
if (eap->addr_count == 0)
win_close(curwin, FALSE); /* don't free buffer */
else
win_close(win, FALSE);
}
}
-#endif
}
/*
}
else
{
-#ifdef FEAT_WINDOWS
if (only_one_window()) /* quit last window, exit Vim */
-#endif
getout(0);
-#ifdef FEAT_WINDOWS
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
/* Quit current window, may free the buffer. */
win_close(curwin, !buf_hide(curwin->w_buffer));
-#endif
}
}
do_shell(NULL, 0);
}
-#if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \
+#if defined(HAVE_DROP_FILE) \
|| (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \
|| defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MAC) \
}
if (split)
{
-# ifdef FEAT_WINDOWS
if (win_split(0, 0) == FAIL)
return;
RESET_BINDING(curwin);
* existing one is overwritten. */
alist_unlink(curwin->w_alist);
alist_new();
-# else
- return; /* can't split, always fail */
-# endif
}
/*
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
-
/*
* Remove a reference from an argument list.
* Ignored when the argument list is the global one.
}
}
-# if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
+#if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
/*
* Create a new argument list and use it for the current window.
*/
alist_init(curwin->w_alist);
}
}
-# endif
#endif
#if !defined(UNIX) || defined(PROTO)
}
else
FreeWild(count, files);
-#ifdef FEAT_WINDOWS
if (al == &global_alist)
-#endif
arg_had_last = FALSE;
}
alist_slash_adjust(void)
{
int i;
-# ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
-# endif
for (i = 0; i < GARGCOUNT; ++i)
if (GARGLIST[i].ae_fname != NULL)
slash_adjust(GARGLIST[i].ae_fname);
-# ifdef FEAT_WINDOWS
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_alist != &global_alist)
for (i = 0; i < WARGCOUNT(wp); ++i)
if (WARGLIST(wp)[i].ae_fname != NULL)
slash_adjust(WARGLIST(wp)[i].ae_fname);
-# endif
}
#endif
eap->errmsg = e_invcmd;
}
-#ifdef FEAT_WINDOWS
/*
* :sview [+command] file split window with new file, read-only
* :split [[+command] file] split window with current or new file
ex_splitview(exarg_T *eap)
{
win_T *old_curwin = curwin;
-# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
char_u *fname = NULL;
-# endif
-# ifdef FEAT_BROWSE
+#endif
+#ifdef FEAT_BROWSE
int browse_flag = cmdmod.browse;
-# endif
+#endif
-# ifdef FEAT_GUI
+#ifdef FEAT_GUI
need_mouse_correct = TRUE;
-# endif
+#endif
-# ifdef FEAT_QUICKFIX
+#ifdef FEAT_QUICKFIX
/* A ":split" in the quickfix window works like ":new". Don't want two
* quickfix windows. But it's OK when doing ":tab split". */
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
if (eap->cmdidx == CMD_vsplit)
eap->cmdidx = CMD_vnew;
}
-# endif
+#endif
-# ifdef FEAT_SEARCHPATH
+#ifdef FEAT_SEARCHPATH
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
{
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
goto theend;
eap->arg = fname;
}
-# ifdef FEAT_BROWSE
+# ifdef FEAT_BROWSE
else
-# endif
# endif
-# ifdef FEAT_BROWSE
+#endif
+#ifdef FEAT_BROWSE
if (cmdmod.browse
&& eap->cmdidx != CMD_vnew
&& eap->cmdidx != CMD_new)
}
}
cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
-# endif
+#endif
/*
* Either open new tab page or split the window.
}
}
-#endif /* FEAT_WINDOWS */
-
/*
* ":mode": Set screen mode.
* If no argument given, just get the screen size and redraw.
mch_screenmode(eap->arg);
}
-#ifdef FEAT_WINDOWS
/*
* ":resize".
* set, increment or decrement current window height
win_setheight_win((int)n, wp);
}
}
-#endif
/*
* ":find [+command] <file>" command.
win_T *old_curwin) /* curwin before doing a split or NULL */
{
int n;
-#ifdef FEAT_WINDOWS
int need_hide;
-#endif
int exmode_was = exmode_active;
/*
if ((eap->cmdidx == CMD_new
|| eap->cmdidx == CMD_tabnew
|| eap->cmdidx == CMD_tabedit
-#ifdef FEAT_WINDOWS
- || eap->cmdidx == CMD_vnew
-#endif
- ) && *eap->arg == NUL)
+ || eap->cmdidx == CMD_vnew) && *eap->arg == NUL)
{
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
setpcmark();
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
old_curwin == NULL ? curwin : NULL);
}
- else if ((eap->cmdidx != CMD_split
-#ifdef FEAT_WINDOWS
- && eap->cmdidx != CMD_vsplit
-#endif
- )
+ else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|| *eap->arg != NUL
#ifdef FEAT_BROWSE
|| cmdmod.browse
, old_curwin == NULL ? curwin : NULL) == FAIL)
{
/* Editing the file failed. If the window was split, close it. */
-#ifdef FEAT_WINDOWS
if (old_curwin != NULL)
{
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
if (!need_hide || buf_hide(curbuf))
{
-# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
cleanup_T cs;
/* Reset the error/interrupt/exception state here so that
* aborting() returns FALSE when closing a window. */
enter_cleanup(&cs);
-# endif
-# ifdef FEAT_GUI
+#endif
+#ifdef FEAT_GUI
need_mouse_correct = TRUE;
-# endif
+#endif
win_close(curwin, !need_hide && !buf_hide(curbuf));
-# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not
* discarded by a new aborting error, interrupt, or
* uncaught exception. */
leave_cleanup(&cs);
-# endif
+#endif
}
}
-#endif
}
else if (readonlymode && curbuf->b_nwindows == 1)
{
#endif
}
-#ifdef FEAT_WINDOWS
/*
* if ":split file" worked, set alternate file name in old window to new
* file
&& old_curwin->w_buffer != curbuf
&& !cmdmod.keepalt)
old_curwin->w_alt_fnum = curbuf->b_fnum;
-#endif
ex_no_reprint = TRUE;
}
curwin->w_scbind_pos = topline;
redraw_later(VALID);
cursor_correct();
-#ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
-#endif
}
}
curwin = save_curwin;
EMSG(_("E465: :winsize requires two number arguments"));
}
-#ifdef FEAT_WINDOWS
static void
ex_wincmd(exarg_T *eap)
{
postponed_split_tab = 0;
}
}
-#endif
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
/*
static void
ex_redrawstatus(exarg_T *eap UNUSED)
{
-#if defined(FEAT_WINDOWS)
int r = RedrawingDisabled;
int p = p_lz;
RedrawingDisabled = r;
p_lz = p;
out_flush();
-#endif
}
static void
(linenr_T)1, (linenr_T)MAXLNUM);
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/*
* ":psearch"
*/
}
#endif
-#ifdef FEAT_WINDOWS
-# ifdef FEAT_QUICKFIX
+#ifdef FEAT_QUICKFIX
/*
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
*/
}
g_do_tagpreview = 0;
}
-# endif
+#endif
/*
* ":stag", ":stselect" and ":stjump".
postponed_split_flags = 0;
postponed_split_tab = 0;
}
-#endif
/*
* ":tag", ":tselect", ":tjump", ":tnext", etc.
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+#if defined(FEAT_KEYMAP)
/* Show/unshow value of 'keymap' in status lines later. */
status_redraw_curbuf();
#endif
end_pos = curwin->w_cursor; /* shutup gcc 4 */
validate_cursor();
-# ifdef FEAT_WINDOWS
/* May redraw the status line to show the cursor position. */
if (p_ru && curwin->w_status_height > 0)
curwin->w_redr_status = TRUE;
-# endif
save_cmdline(&save_ccline);
update_screen(SOME_VALID);
*/
/*
+ * These features used to be optional but are now always enabled.
* +windows Multiple windows. Without this there is no help
* window and no status lines.
* +vertsplit Vertically split windows.
*/
-#ifdef FEAT_SMALL
-# define FEAT_WINDOWS
-#endif
/*
* +listcmds Vim commands for the buffer list and the argument
# define FEAT_JUMPLIST
#endif
-/* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */
-#if defined(FEAT_WINDOWS) && defined(FEAT_CMDHIST)
+/* the cmdline-window requires FEAT_CMDHIST */
+#if defined(FEAT_CMDHIST)
# define FEAT_CMDWIN
#endif
* +diff Displaying diffs in a nice way.
* Requires +windows and +autocmd.
*/
-#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_AUTOCMD)
+#if defined(FEAT_NORMAL) && defined(FEAT_AUTOCMD)
# define FEAT_DIFF
#endif
/*
* +wildmenu 'wildmenu' option
*/
-#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+#if defined(FEAT_NORMAL)
# define FEAT_WILDMENU
#endif
* +mksession ":mksession" command.
* Requires +windows and +vertsplit.
*/
-#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+#if defined(FEAT_NORMAL)
# define FEAT_SESSION
#endif
/*
* +scrollbind synchronization of split windows
*/
-#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+#if defined(FEAT_NORMAL)
# define FEAT_SCROLLBIND
#endif
/*
* +cursorbind synchronization of split windows
*/
-#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+#if defined(FEAT_NORMAL)
# define FEAT_CURSORBIND
#endif
/*
* GUI tabline
*/
-#if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \
+#if defined(FEAT_NORMAL) \
&& (defined(FEAT_GUI_GTK) \
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
|| defined(FEAT_GUI_MAC) \
#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)
* 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)) \
buf_T *buf) /* new curbuf */
{
win_T *win;
-#ifdef FEAT_WINDOWS
int save_ea;
-#endif
#ifdef FEAT_AUTOCHDIR
int save_acd;
#endif
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. */
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();
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;
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();
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;
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
/* Exported folding functions. {{{1 */
/* copyFoldingState() {{{2 */
-#if defined(FEAT_WINDOWS) || defined(PROTO)
+
/*
* Copy that folding state from window "wp_from" to window "wp_to".
*/
wp_to->w_foldinvalid = wp_from->w_foldinvalid;
cloneFoldGrowArray(&wp_from->w_folds, &wp_to->w_folds);
}
-#endif
/* hasAnyFolding() {{{2 */
/*
msg_row = Rows - 1;
msg_clr_eos(); /* clear ruler */
}
-#ifdef FEAT_WINDOWS
status_redraw_all();
redraw_statuslines();
-#endif
showmode();
setcursor();
continue;
EXTERN schar_T *ScreenLines2 INIT(= NULL);
#endif
-#ifdef FEAT_WINDOWS
/*
* Indexes for tab page line:
* N > 0 for label of tab page N
* N == -999 for closing current tab page
*/
EXTERN short *TabPageIdxs INIT(= NULL);
-#endif
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */
EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the
mouse pointer shape */
-# ifdef FEAT_WINDOWS
EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
-# endif
# endif
#endif
* All windows are linked in a list. firstwin points to the first entry,
* lastwin to the last entry (can be the same as firstwin) and curwin to the
* currently active window.
- * Without the FEAT_WINDOWS they are all equal.
*/
-#ifdef FEAT_WINDOWS
EXTERN win_T *firstwin; /* first window */
EXTERN win_T *lastwin; /* last window */
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
for ((wp) = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
-#else
-# define firstwin curwin
-# define lastwin curwin
-# define ONE_WINDOW 1
-# define W_NEXT(wp) NULL
-# define FOR_ALL_WINDOWS(wp) wp = curwin;
-# define FOR_ALL_TABPAGES(tp) for (;FALSE;)
-# define FOR_ALL_WINDOWS_IN_TAB(tp, wp) wp = curwin;
-# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin;
-#endif
EXTERN win_T *curwin; /* currently active window */
*/
EXTERN frame_T *topframe; /* top of the window frame tree */
-#ifdef FEAT_WINDOWS
/*
* Tab pages are alternative topframes. "first_tabpage" points to the first
* one in the list, "curtab" is the current one.
EXTERN tabpage_T *first_tabpage;
EXTERN tabpage_T *curtab;
EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */
-#endif
/*
* All buffers are linked in a list. 'firstbuf' points to the first entry,
EXTERN buf_T *last_changedtick_buf INIT(= NULL);
#endif
-#ifdef FEAT_WINDOWS
EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */
EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */
EXTERN int postponed_split_tab INIT(= 0); /* cmdmod.tab */
-# ifdef FEAT_QUICKFIX
+#ifdef FEAT_QUICKFIX
EXTERN int g_do_tagpreview INIT(= 0); /* for tag preview commands:
height of preview window */
-# endif
#endif
EXTERN int replace_offset INIT(= 0); /* offset for replace_push() */
EXTERN int lcs_conceal INIT(= ' ');
#endif
-#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
- || defined(FEAT_FOLDING)
/* Characters from 'fillchars' option */
EXTERN int fill_stl INIT(= ' ');
EXTERN int fill_stlnc INIT(= ' ');
-#endif
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
EXTERN int fill_vert INIT(= ' ');
EXTERN int fill_fold INIT(= '-');
EXTERN int fill_diff INIT(= '-');
-#endif
#ifdef FEAT_FOLDING
EXTERN int disable_fold_update INIT(= 0);
EXTERN char_u e_noprev[] INIT(= N_("E34: No previous command"));
EXTERN char_u e_noprevre[] INIT(= N_("E35: No previous regular expression"));
EXTERN char_u e_norange[] INIT(= N_("E481: No range allowed"));
-#ifdef FEAT_WINDOWS
EXTERN char_u e_noroom[] INIT(= N_("E36: Not enough room"));
-#endif
#ifdef FEAT_CLIENTSERVER
EXTERN char_u e_noserver[] INIT(= N_("E247: no registered server named \"%s\""));
#endif
EXTERN char_u e_trailing[] INIT(= N_("E488: Trailing characters"));
EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark"));
EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
-#ifdef FEAT_WINDOWS
EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
-#endif
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
#ifdef FEAT_EVAL
min_width = base_width + MIN_COLUMNS * gui.char_width;
min_height = base_height + MIN_LINES * gui.char_height;
-#ifdef FEAT_WINDOWS
min_height += tabline_height() * gui.char_height;
-#endif
#ifdef FEAT_GUI_GTK
if (un_maximize)
gui.scroll_region_bot = arg1;
}
break;
-#ifdef FEAT_WINDOWS
case 'V': /* Set vertical scroll region */
if (arg1 < arg2)
{
gui.scroll_region_right = arg1;
}
break;
-#endif
case 'd': /* Delete line */
gui_delete_lines(gui.row, 1);
break;
* Visual selection.
*/
if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
- && Y_2_ROW(y) >= topframe->fr_height
-# ifdef FEAT_WINDOWS
- + firstwin->w_winrow
-# endif
+ && Y_2_ROW(y) >= topframe->fr_height + firstwin->w_winrow
&& button != MOUSE_DRAG
# ifdef FEAT_MOUSESHAPE
&& !drag_status_line
-# ifdef FEAT_WINDOWS
&& !drag_sep_line
-# endif
# endif
)
checkfor = MOUSE_NONE;
case GO_RIGHT:
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
break;
-#ifdef FEAT_WINDOWS
case GO_VLEFT:
if (win_hasvertsplit())
gui.which_scrollbars[SBAR_LEFT] = TRUE;
if (win_hasvertsplit())
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
break;
-#endif
case GO_BOT:
gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
break;
* shown/unshown. Thus we need two places to remember whether a
* scrollbar is there or not. */
if (gui.which_scrollbars[i] != prev_which_scrollbars[i]
-#ifdef FEAT_WINDOWS
|| gui.which_scrollbars[i]
- != curtab->tp_prev_which_scrollbars[i]
-#endif
- )
+ != curtab->tp_prev_which_scrollbars[i])
{
if (i == SBAR_BOTTOM)
gui_mch_enable_scrollbar(&gui.bottom_sbar,
fix_size = TRUE;
}
}
-#ifdef FEAT_WINDOWS
curtab->tp_prev_which_scrollbars[i] = gui.which_scrollbars[i];
-#endif
prev_which_scrollbars[i] = gui.which_scrollbars[i];
}
Columns = prev_Columns;
#endif
}
-#ifdef FEAT_WINDOWS
/* When the console tabline appears or disappears the window positions
* change. */
if (firstwin->w_winrow != tabline_height())
shell_new_rows(); /* recompute window positions and heights */
-#endif
}
}
* Scrollbar stuff:
*/
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Remove all scrollbars. Used before switching to another tab page.
*/
curtab->tp_prev_which_scrollbars[i] = -1;
}
}
-#endif
void
gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
sb->max = 1;
sb->top = 0;
sb->height = 0;
-#ifdef FEAT_WINDOWS
sb->width = 0;
-#endif
sb->status_height = 0;
gui_mch_create_scrollbar(sb, (wp == NULL) ? SBAR_HORIZ : SBAR_VERT);
}
void
gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
{
-#ifdef FEAT_WINDOWS
win_T *wp;
-#endif
int sb_num;
#ifdef USE_ON_FLY_SCROLL
colnr_T old_leftcol = curwin->w_leftcol;
if (sb->wp != NULL) /* vertical scrollbar */
{
sb_num = 0;
-#ifdef FEAT_WINDOWS
for (wp = firstwin; wp != sb->wp && wp != NULL; wp = wp->w_next)
sb_num++;
if (wp == NULL)
return;
-#else
- if (sb->wp != curwin)
- return;
-#endif
#ifdef USE_ON_FLY_SCROLL
current_scrollbar = sb_num;
* Scrollbar stuff:
*/
-#if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Called when something in the window layout has changed.
*/
}
need_mouse_correct = TRUE;
}
-#endif
void
gui_update_scrollbars(
long val, size, max; /* need 32 bits here */
int which_sb;
int h, y;
-#ifdef FEAT_WINDOWS
static win_T *prev_curwin = NULL;
-#endif
/* Update the horizontal scrollbar */
gui_update_horiz_scrollbar(force);
continue;
}
if (force || sb->height != wp->w_height
-#ifdef FEAT_WINDOWS
|| sb->top != wp->w_winrow
|| sb->status_height != wp->w_status_height
|| sb->width != wp->w_width
- || prev_curwin != curwin
-#endif
- )
+ || prev_curwin != curwin)
{
/* Height, width or position of scrollbar has changed. For
* vertical split: curwin changed. */
sb->height = wp->w_height;
-#ifdef FEAT_WINDOWS
sb->top = wp->w_winrow;
sb->status_height = wp->w_status_height;
sb->width = wp->w_width;
-#endif
/* Calculate height and position in pixels */
h = (sb->height + sb->status_height) * gui.char_height;
y += gui.tabline_height;
#endif
-#ifdef FEAT_WINDOWS
if (wp->w_winrow == 0)
-#endif
{
/* Height of top scrollbar includes width of top border */
h += gui.border_offset;
val, size, max);
}
}
-#ifdef FEAT_WINDOWS
prev_curwin = curwin;
-#endif
--hold_gui_events;
}
int which, /* SBAR_LEFT or SBAR_RIGHT */
int enable) /* TRUE to enable scrollbar */
{
-#ifdef FEAT_WINDOWS
int midcol = curwin->w_wincol + curwin->w_width / 2;
int has_midcol = (wp->w_wincol <= midcol
&& wp->w_wincol + wp->w_width >= midcol);
enable = FALSE;
}
}
-#endif
gui_mch_enable_scrollbar(&wp->w_scrollbars[which], enable);
}
if (wp == curwin || wp == NULL)
return; /* still in the same old window, or none at all */
-#ifdef FEAT_WINDOWS
/* Ignore position in the tab pages line. */
if (Y_2_ROW(y) < tabline_height())
return;
-#endif
/*
* format a mouse click on status line input
st[2] = KE_FILLER;
st[3] = (char_u)MOUSE_LEFT;
fill_mouse_coord(st + 4,
-#ifdef FEAT_WINDOWS
wp->w_wincol == 0 ? -1 : wp->w_wincol + MOUSE_COLOFF,
-#else
- -1,
-#endif
wp->w_height + W_WINROW(wp));
add_to_input_buf(st, 8);
/* Don't move the mouse when it's left or right of the Vim window */
if (x < 0 || x > Columns * gui.char_width)
return;
- if (y >= 0
-# ifdef FEAT_WINDOWS
- && Y_2_ROW(y) >= tabline_height()
-# endif
- )
+ if (y >= 0 && Y_2_ROW(y) >= tabline_height())
wp = xy2win(x, y);
if (wp != curwin && wp != NULL) /* If in other than current window */
{
static win_T *
xy2win(int x UNUSED, int y UNUSED)
{
-#ifdef FEAT_WINDOWS
int row;
int col;
win_T *wp;
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return NULL;
-# ifdef FEAT_MOUSESHAPE
+#ifdef FEAT_MOUSESHAPE
if (State == HITRETURN || State == ASKMORE)
{
if (Y_2_ROW(y) >= msg_row)
update_mouseshape(SHAPE_IDX_STATUS);
else
update_mouseshape(-2);
-# endif
- return wp;
-#else
- return firstwin;
#endif
+ return wp;
}
/*
|| defined(FEAT_GUI_MAC) \
|| defined(PROTO)
-#ifdef FEAT_WINDOWS
static void gui_wingoto_xy(int x, int y);
/*
win_goto(wp);
}
}
-#endif
/*
* Process file drop. Mouse cursor position, key modifiers, name of files
{
/* Go to the window under mouse cursor, then shorten given "fnames" by
* current window, because a window can have local current dir. */
-# ifdef FEAT_WINDOWS
gui_wingoto_xy(x, y);
-# endif
shorten_filenames(fnames, count);
/* If Shift held down, remember the first item. */
/* Values measured in characters: */
int top; /* Top of scroll bar (chars from row 0) */
int height; /* Current height of scroll bar in rows */
-#ifdef FEAT_WINDOWS
int width; /* Current width of scroll bar in cols */
-#endif
int status_height; /* Height of status line */
#ifdef FEAT_GUI_X11
Widget id; /* Id of real scroll bar */
#endif
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
if (sb->id != (Widget)0)
XtDestroyWidget(sb->id);
}
-#endif
void
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
char_u *bexpr;
buf_T *save_curbuf;
size_t len;
-# ifdef FEAT_WINDOWS
win_T *cw;
-# endif
#endif
static int recursive = FALSE;
: wp->w_buffer->b_p_bexpr;
if (*bexpr != NUL)
{
-# ifdef FEAT_WINDOWS
/* Convert window pointer to number. */
for (cw = firstwin; cw != wp; cw = cw->w_next)
++winnr;
-# endif
set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
set_vim_var_nr(VV_BEVAL_WINNR, winnr);
*textp = NULL;
row = Y_2_ROW(beval->y);
col = X_2_COL(beval->x);
-#ifdef FEAT_WINDOWS
wp = mouse_find_win(&row, &col);
-#else
- wp = firstwin;
-#endif
if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
{
/* Found a window and the cursor is in the text. Now find the line
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
}
gui_mch_update();
}
-#endif
#if defined(FEAT_BROWSE) || defined(PROTO)
/*
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
if (sb->id != (Widget)0)
XtDestroyWidget(sb->id);
}
-#endif
void
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
DestroyWindow(sb->id);
}
-#endif
/*
* Get current mouse coordinates in text window.
HWND hwnd UNUSED,
HDROP hDrop)
{
-#ifdef FEAT_WINDOWS
-# define BUFPATHLEN _MAX_PATH
-# define DRAGQVAL 0xFFFFFFFF
-# ifdef FEAT_MBYTE
+#define BUFPATHLEN _MAX_PATH
+#define DRAGQVAL 0xFFFFFFFF
+#ifdef FEAT_MBYTE
WCHAR wszFile[BUFPATHLEN];
-# endif
+#endif
char szFile[BUFPATHLEN];
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
UINT i;
if (fnames != NULL)
for (i = 0; i < cFiles; ++i)
{
-# ifdef FEAT_MBYTE
+#ifdef FEAT_MBYTE
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
fnames[i] = utf16_to_enc(wszFile, NULL);
else
-# endif
+#endif
{
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
fnames[i] = vim_strsave((char_u *)szFile);
s_need_activate = TRUE;
}
-#endif
}
static int
#endif
s_hdc = GetDC(s_textArea);
-#ifdef FEAT_WINDOWS
DragAcceptFiles(s_hwnd, TRUE);
-#endif
/* Do we need to bother with this? */
/* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
State &= ~LANGMAP;
if (State & INSERT)
{
-#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+#if defined(FEAT_KEYMAP)
/* Unshown 'keymap' in status lines */
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
{
return;
}
-#ifdef FEAT_WINDOWS
if (make_split)
{
if (!cmdp->cansplit)
postponed_split_flags = cmdmod.split;
postponed_split_tab = cmdmod.tab;
}
-#endif
cmdp->func(eap);
-#ifdef FEAT_WINDOWS
postponed_split_flags = 0;
postponed_split_tab = 0;
-#endif
}
/*
if (!ret)
{
(void)EMSG(_("E257: cstag: tag not found"));
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
g_do_tagpreview = 0;
#endif
}
if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m",
*qfpos == '-', cmdline, NULL) > 0)
{
-# ifdef FEAT_WINDOWS
if (postponed_split != 0)
{
(void)win_split(postponed_split > 0 ? postponed_split : 0,
RESET_BINDING(curwin);
postponed_split = 0;
}
-# endif
# ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
char *cstag_msg = _("Cscope tag: %s");
char *csfmt_str = "%4d %6s ";
- assert (num_matches > 0);
+ assert(num_matches > 0);
if ((tbuf = (char *)alloc((unsigned)strlen(matches[0]) + 1)) == NULL)
return;
lua_pushinteger(L, w->w_cursor.lnum);
else if (strncmp(s, "col", 3) == 0)
lua_pushinteger(L, w->w_cursor.col + 1);
-#ifdef FEAT_WINDOWS
else if (strncmp(s, "width", 5) == 0)
lua_pushinteger(L, W_WIDTH(w));
-#endif
else if (strncmp(s, "height", 6) == 0)
lua_pushinteger(L, w->w_height);
/* methods */
w->w_cursor.col = v - 1;
update_screen(VALID);
}
-#ifdef FEAT_WINDOWS
else if (strncmp(s, "width", 5) == 0)
{
win_T *win = curwin;
win_setwidth(v);
curwin = win;
}
-#endif
else if (strncmp(s, "height", 6) == 0)
{
win_T *win = curwin;
static Scheme_Object *get_window_buffer(void *, int, Scheme_Object **);
static Scheme_Object *get_window_height(void *, int, Scheme_Object **);
static Scheme_Object *set_window_height(void *, int, Scheme_Object **);
-#ifdef FEAT_WINDOWS
static Scheme_Object *get_window_width(void *, int, Scheme_Object **);
static Scheme_Object *set_window_width(void *, int, Scheme_Object **);
-#endif
static Scheme_Object *get_cursor(void *, int, Scheme_Object **);
static Scheme_Object *set_cursor(void *, int, Scheme_Object **);
static Scheme_Object *get_window_list(void *, int, Scheme_Object **);
get_window_count(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
{
int n = 0;
-#ifdef FEAT_WINDOWS
win_T *w;
FOR_ALL_WINDOWS(w)
-#endif
++n;
return scheme_make_integer(n);
}
buf = get_buffer_arg(prim->name, 0, argc, argv);
list = scheme_null;
-#ifdef FEAT_WINDOWS
for ( ; w != NULL; w = w->w_next)
-#endif
if (w->w_buffer == buf->buf)
{
list = scheme_make_pair(window_new(w), list);
get_window_num(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
{
int nr = 1;
-#ifdef FEAT_WINDOWS
Vim_Prim *prim = (Vim_Prim *)data;
win_T *win = get_window_arg(prim->name, 0, argc, argv)->win;
win_T *wp;
for (wp = firstwin; wp != win; wp = wp->w_next)
-#endif
++nr;
return scheme_make_integer(nr);
if (fnum < 1)
scheme_signal_error(_("window index is out of range"));
-#ifdef FEAT_WINDOWS
for ( ; win != NULL; win = win->w_next, --fnum)
-#endif
if (fnum == 1) /* to be 1-based */
return window_new(win);
return scheme_void;
}
-#ifdef FEAT_WINDOWS
/* (get-win-width [window]) */
static Scheme_Object *
get_window_width(void *data, int argc, Scheme_Object **argv)
raise_if_error();
return scheme_void;
}
-#endif
/* (get-cursor [window]) -> (line . col) */
static Scheme_Object *
{get_window_buffer, "get-win-buffer", 0, 1},
{get_window_height, "get-win-height", 0, 1},
{set_window_height, "set-win-height", 1, 2},
-#ifdef FEAT_WINDOWS
{get_window_width, "get-win-width", 0, 1},
{set_window_width, "set-win-width", 1, 2},
-#endif
{get_cursor, "get-cursor", 0, 1},
{set_cursor, "set-cursor", 1, 2},
{get_window_list, "get-win-list", 0, 1},
}
#endif /* PERLIO_LAYERS && !USE_SFIO */
-#ifndef FEAT_WINDOWS
- int
-win_valid(win_T *w)
-{
- return TRUE;
-}
- int
-win_count(void)
-{
- return 1;
-}
- win_T *
-win_find_nr(int n)
-{
- return curwin;
-}
-#endif
-
XS(boot_VIM);
static void
}
else if (strcmp(name, "height") == 0)
return PyLong_FromLong((long)(self->win->w_height));
-#ifdef FEAT_WINDOWS
else if (strcmp(name, "row") == 0)
return PyLong_FromLong((long)(self->win->w_winrow));
else if (strcmp(name, "width") == 0)
return PyLong_FromLong((long)(W_WIDTH(self->win)));
else if (strcmp(name, "col") == 0)
return PyLong_FromLong((long)(W_WINCOL(self->win)));
-#endif
else if (strcmp(name, "vars") == 0)
return NEW_DICTIONARY(self->win->w_vars);
else if (strcmp(name, "options") == 0)
return 0;
}
-#ifdef FEAT_WINDOWS
else if (strcmp(name, "width") == 0)
{
long width;
return 0;
}
-#endif
else
{
PyErr_SetString(PyExc_AttributeError, name);
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
python_window_free(win_T *win)
{
TAB_PYTHON_REF(tab) = NULL;
}
}
-#endif
static int
PythonMod_Init(void)
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
python3_window_free(win_T *win)
{
TAB_PYTHON_REF(tab) = NULL;
}
}
-#endif
static PyObject *
Py3Init_vim(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)
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;
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;
}
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
void
tcl_window_free(win_T *win)
{
win->w_tcl_ref = NULL;
}
}
-#endif
/* The End */
static void check_tty(mparm_T *parmp);
static void read_stdin(void);
static void create_windows(mparm_T *parmp);
-# ifdef FEAT_WINDOWS
static void edit_buffers(mparm_T *parmp, char_u *cwd);
-# endif
static void exe_pre_commands(mparm_T *parmp);
static void exe_commands(mparm_T *parmp);
static void source_startup_scripts(mparm_T *parmp);
#ifdef FEAT_EVAL
params.use_debug_break_level = -1;
#endif
-#ifdef FEAT_WINDOWS
params.window_count = -1;
-#endif
#ifdef FEAT_RUBY
{
}
#endif
-#ifdef FEAT_WINDOWS
/*
* If opened more than one window, start editing files in the other
* windows.
*/
edit_buffers(¶ms, start_dir);
-#endif
vim_free(start_dir);
#ifdef FEAT_DIFF
mch_set_winsize_now(); /* Allow winsize changes from now on */
#endif
-#if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+#if defined(FEAT_GUI)
/* When tab pages were created, may need to update the tab pages line and
* scrollbars. This is skipped while creating them. */
if (first_tabpage->tp_next != NULL)
update_screen(0);
else if (redraw_cmdline || clear_cmdline)
showmode();
-#ifdef FEAT_WINDOWS
redraw_statuslines();
-#endif
#ifdef FEAT_TITLE
if (need_maketitle)
maketitle();
if (get_vim_var_nr(VV_DYING) <= 1)
{
/* Trigger BufWinLeave for all windows, but only once per buffer. */
-# if defined FEAT_WINDOWS
for (tp = first_tabpage; tp != NULL; tp = next_tp)
{
next_tp = tp->tp_next;
}
}
}
-# else
- apply_autocmds(EVENT_BUFWINLEAVE, curbuf, curbuf->b_fname,
- FALSE, curbuf);
-# endif
/* Trigger BufUnload for buffers that are loaded */
FOR_ALL_BUFFERS(buf)
break;
}
#endif
-#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_TABS;
-#endif
break;
case 'o': /* "-o[N]" open N horizontal split windows */
-#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_HOR;
-#endif
break;
case 'O': /* "-O[N]" open N vertical split windows */
-#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_VER;
-#endif
break;
#ifdef FEAT_QUICKFIX
static void
create_windows(mparm_T *parmp UNUSED)
{
-#ifdef FEAT_WINDOWS
int dorewind;
int done = 0;
}
else
parmp->window_count = 1;
-#endif
if (recoverymode) /* do recover */
{
++autocmd_no_enter;
++autocmd_no_leave;
#endif
-#ifdef FEAT_WINDOWS
dorewind = TRUE;
while (done++ < 1000)
{
curwin = curwin->w_next;
}
dorewind = FALSE;
-#endif
curbuf = curwin->w_buffer;
if (curbuf->b_ml.ml_mfp == NULL)
{
dorewind = TRUE; /* start again */
#endif
}
-#ifdef FEAT_WINDOWS
ui_breakcheck();
if (got_int)
{
break;
}
}
-#endif
-#ifdef FEAT_WINDOWS
if (parmp->window_layout == WIN_TABS)
goto_tabpage(1);
else
curwin = firstwin;
curbuf = curwin->w_buffer;
-#endif
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
--autocmd_no_leave;
}
}
-#ifdef FEAT_WINDOWS
/*
* If opened more than one window, start editing files in the other
* windows. make_windows() has already opened the windows.
/* make the first window the current window */
win = firstwin;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/* Avoid making a preview window the current window. */
while (win->w_p_pvw)
{
#endif
win_enter(win, FALSE);
-# ifdef FEAT_AUTOCMD
+#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
-# endif
+#endif
TIME_MSG("editing files in windows");
if (parmp->window_count > 1 && parmp->window_layout != WIN_TABS)
win_equal(curwin, FALSE, 'b'); /* adjust heights */
}
-#endif /* FEAT_WINDOWS */
/*
* Execute the commands from --cmd arguments "cmds[cnt]".
main_msg(_("-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"));
#endif
main_msg(_("--noplugin\t\tDon't load plugin scripts"));
-#ifdef FEAT_WINDOWS
main_msg(_("-p[N]\t\tOpen N tab pages (default: one for each file)"));
main_msg(_("-o[N]\t\tOpen N windows (default: one for each file)"));
main_msg(_("-O[N]\t\tLike -o but split vertically"));
-#endif
main_msg(_("+\t\t\tStart at end of file"));
main_msg(_("+<lnum>\t\tStart at line <lnum>"));
main_msg(_("--cmd <command>\tExecute <command> before loading any vimrc file"));
main_msg(_("--remote-silent <files> Same, don't complain if there is no server"));
main_msg(_("--remote-wait <files> As --remote but wait for files to have been edited"));
main_msg(_("--remote-wait-silent <files> Same, don't complain if there is no server"));
-# ifdef FEAT_WINDOWS
main_msg(_("--remote-tab[-wait][-silent] <files> As --remote but use tab page per file"));
-# endif
main_msg(_("--remote-send <keys>\tSend <keys> to a Vim server and exit"));
main_msg(_("--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"));
main_msg(_("--serverlist\t\tList available Vim server names and exit"));
int fnum = curbuf->b_fnum;
linenr_T *lp;
win_T *win;
-#ifdef FEAT_WINDOWS
tabpage_T *tab;
-#endif
static pos_T initpos = INIT_POS_T(1, 0, 0);
if (line2 < line1 && amount_after == 0L) /* nothing to do */
curwin->w_jumplistlen = to;
}
-# if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Copy the jumplist from window "from" to window "to".
*/
for (i = 0; i < wp->w_jumplistlen; ++i)
vim_free(wp->w_jumplist[i].fname);
}
-# endif
#endif /* FEAT_JUMPLIST */
void
buf_T *buf;
int is_mark_set;
int i;
-#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
*/
FOR_ALL_TAB_WINDOWS(tp, win)
set_last_cursor(win);
-#else
- set_last_cursor(curwin);
-#endif
fputs(_("\n# History of marks within files (newest to oldest):\n"), fp_out);
FOR_ALL_BUFFERS(buf)
return ml_append_int(curbuf, lnum, line, len, newfile, FALSE);
}
-#if defined(FEAT_SPELL) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
- || defined(PROTO)
+#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Like ml_append() but for an arbitrary buffer. The buffer must already have
* a memline.
}
/*
- * Delete line 'lnum' in the current buffer.
+ * Delete line "lnum" in the current buffer.
+ * When "message" is TRUE may give a "No lines in buffer" message.
*
* Check: The caller of this function should probably also call
* deleted_lines() after this.
if (!wp->w_p_wrap)
return 1;
-#ifdef FEAT_WINDOWS
if (wp->w_width == 0)
return 1;
-#endif
#ifdef FEAT_FOLDING
/* A folded lines is handled just like an empty line. */
if (!wp->w_p_wrap)
return lines + 1;
-#ifdef FEAT_WINDOWS
if (wp->w_width == 0)
return lines + 1;
-#endif
line = s = ml_get_buf(wp->w_buffer, lnum, FALSE);
{
curbuf->b_changed = TRUE;
ml_setflags(curbuf);
-#ifdef FEAT_WINDOWS
check_status(curbuf);
redraw_tabline = TRUE;
-#endif
#ifdef FEAT_TITLE
need_maketitle = TRUE; /* set window title later */
#endif
long xtra)
{
win_T *wp;
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
-#endif
int i;
#ifdef FEAT_JUMPLIST
int cols;
ml_setflags(buf);
if (ff)
save_file_ff(buf);
-#ifdef FEAT_WINDOWS
check_status(buf);
redraw_tabline = TRUE;
-#endif
#ifdef FEAT_TITLE
need_maketitle = TRUE; /* set window title later */
#endif
#endif
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* check_status: called when the status bars for the buffer 'buf'
* need to be updated
must_redraw = VALID;
}
}
-#endif
/*
* If the file is readonly, give a warning message with the first change.
}
#endif
-#if defined(FEAT_GUI_TABLINE) || defined(FEAT_WINDOWS) \
- || defined(FEAT_EVAL) || defined(PROTO)
/*
* Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname"
* It's done in-place.
}
}
}
-#endif
/*
* Return TRUE if the directory of "fname" exists, FALSE otherwise.
if (finetune
&& curwin->w_p_wrap
-# ifdef FEAT_WINDOWS
&& curwin->w_width != 0
-# endif
&& wcol >= (colnr_T)width)
{
csize = linetabsize(line);
block_autocmds();
# endif
-# ifdef FEAT_WINDOWS
/* Close all tabs and windows. Reset 'equalalways' to avoid redraws. */
p_ea = FALSE;
if (first_tabpage->tp_next != NULL)
do_cmdline_cmd((char_u *)"tabonly!");
if (!ONE_WINDOW)
do_cmdline_cmd((char_u *)"only!");
-# endif
# if defined(FEAT_SPELL)
/* Free all spell info. */
/* Close all script inputs. */
close_all_scripts();
-#if defined(FEAT_WINDOWS)
/* Destroy all windows. Must come before freeing buffers. */
win_free_all();
-#endif
/* Free all buffers. Reset 'autochdir' to avoid accessing things that
* were freed already. */
reset_last_sourcing();
-#ifdef FEAT_WINDOWS
free_tabpage(first_tabpage);
first_tabpage = NULL;
-#endif
# ifdef UNIX
/* Machine-specific free. */
set_string_option_direct((char_u *)"ff", -1, (char_u *)p,
OPT_FREE | opt_flags, 0);
-#ifdef FEAT_WINDOWS
/* This may cause the buffer to become (un)modified. */
check_status(curbuf);
redraw_tabline = TRUE;
-#endif
#ifdef FEAT_TITLE
need_maketitle = TRUE; /* set window title later */
#endif
}
#if defined(FEAT_SESSION) || defined(MSWIN) || defined(FEAT_GUI_MAC) \
- || ((defined(FEAT_GUI_GTK)) \
- && ( defined(FEAT_WINDOWS) || defined(FEAT_DND)) ) \
+ || defined(FEAT_GUI_GTK) \
|| defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
|| defined(PROTO)
/*
}
if (mouse && drag_status_line)
return SHAPE_IDX_SDRAG;
-# ifdef FEAT_WINDOWS
if (mouse && drag_sep_line)
return SHAPE_IDX_VDRAG;
-# endif
#endif
if (!mouse && State == SHOWMATCH)
return SHAPE_IDX_SM;
curwin->w_wcol = W_WIDTH(curwin) - 1;
curwin->w_wrow = curwin->w_height - 1;
}
- else if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ else if (curwin->w_p_wrap && curwin->w_width != 0)
{
width = textwidth + curwin_col_off2();
&& curwin->w_height != 0
&& curwin->w_cursor.lnum == curwin->w_topline
&& width > 0
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ && curwin->w_width != 0)
{
/* Cursor past end of screen. Happens with a single line that does
* not fit on screen. Find a skipcol to show the text around the
* and move the cursor onto the displayed part of the window.
*/
wrow = curwin->w_wrow;
- if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ if (curwin->w_p_wrap && curwin->w_width != 0)
{
validate_virtcol();
validate_cheight();
#else
end_row += plines(curwin->w_topline - 1);
#endif
- if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ if (curwin->w_p_wrap && curwin->w_width != 0)
{
validate_cheight();
validate_virtcol();
#else
start_row = curwin->w_wrow - plines(curwin->w_topline);
#endif
- if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ if (curwin->w_p_wrap && curwin->w_width != 0)
{
validate_virtcol();
start_row -= curwin->w_virtcol / W_WIDTH(curwin);
/* Only scroll when 'scrollbind' hasn't done this. */
if (!curwin->w_p_scb)
update_topline();
-# ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
-# endif
}
}
buf->modified = buf->bufp->b_changed;
if (prev_b_changed != buf->bufp->b_changed)
{
-#ifdef FEAT_WINDOWS
check_status(buf->bufp);
redraw_tabline = TRUE;
-#endif
#ifdef FEAT_TITLE
maketitle();
#endif
if (curbuf != buf) {
if (buf_jump_open_win(buf) != NULL)
return;
-# ifdef FEAT_WINDOWS
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf) != NULL)
return;
-# endif
set_curbuf(buf, DOBUF_GOTO);
}
}
pos_T start_visual;
int moved; /* Has cursor moved? */
int in_status_line; /* mouse in status line */
-#ifdef FEAT_WINDOWS
static int in_tab_line = FALSE; /* mouse clicked in tab line */
int in_sep_line; /* mouse in vertical separator line */
-#endif
int c1, c2;
#if defined(FEAT_FOLDING)
pos_T save_cursor;
if (!is_drag) /* release, reset got_click */
{
got_click = FALSE;
-#ifdef FEAT_WINDOWS
if (in_tab_line)
{
in_tab_line = FALSE;
return FALSE;
}
-#endif
}
}
start_visual.lnum = 0;
-#ifdef FEAT_WINDOWS
/* Check for clicking in the tab page line. */
if (mouse_row == 0 && firstwin->w_winrow > 0)
{
return FALSE;
}
-#endif
-
/*
* When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
* right button up -> pop-up menu
oap == NULL ? NULL : &(oap->inclusive), which_button);
moved = (jump_flags & CURSOR_MOVED);
in_status_line = (jump_flags & IN_STATUS_LINE);
-#ifdef FEAT_WINDOWS
in_sep_line = (jump_flags & IN_SEP_LINE);
-#endif
#ifdef FEAT_NETBEANS_INTG
if (isNetbeansBuffer(curbuf)
do_put(regname, dir, count, fixindent | PUT_CURSEND);
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/*
* Ctrl-Mouse click or double click in a quickfix window jumps to the
* error under the mouse pointer.
}
#endif
}
-#ifdef FEAT_WINDOWS
else if (in_sep_line)
{
-# ifdef FEAT_MOUSESHAPE
+#ifdef FEAT_MOUSESHAPE
if ((is_drag || is_click) && !drag_sep_line)
{
drag_sep_line = TRUE;
update_mouseshape(-1);
}
-# endif
- }
#endif
+ }
else if ((mod_mask & MOD_MASK_MULTI_CLICK) && (State & (NORMAL | INSERT))
&& mouse_has(MOUSE_VISUAL))
{
redraw_later(VALID);
cursor_correct();
-#ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
-#endif
}
/*
{
if (!checkclearop(cap->oap))
{
-#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageUp>: tab page back; <C-PageDown>: tab page forward */
goto_tabpage((int)cap->count0);
}
else
-#endif
- (void)onepage(cap->arg, cap->count1);
+ (void)onepage(cap->arg, cap->count1);
}
}
if (width2 == 0)
width2 = 1; /* avoid divide by zero */
-#ifdef FEAT_WINDOWS
if (curwin->w_width != 0)
-#endif
{
/*
* Instead of sticking at the last character of the buffer line we
static void
nv_mousescroll(cmdarg_T *cap)
{
-# ifdef FEAT_WINDOWS
win_T *old_curwin = curwin, *wp;
if (mouse_row >= 0 && mouse_col >= 0)
curwin = wp;
curbuf = curwin->w_buffer;
}
-# endif
if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
{
}
# endif
-# ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
curwin = old_curwin;
curbuf = curwin->w_buffer;
-# endif
}
/*
}
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Call nv_ident() as if "c1" was used, with "c2" as next character.
*/
ca.nchar = c2;
nv_ident(&ca);
}
-#endif
/*
* Handle the commands that use the word under the cursor.
nv_page(cap);
}
else
-#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) && cap->cmdchar == CAR)
{
static void
nv_window(cmdarg_T *cap)
{
-#ifdef FEAT_WINDOWS
if (cap->nchar == ':')
/* "CTRL-W :" is the same as typing ":"; useful in a terminal window */
nv_colon(cap);
else if (!checkclearop(cap->oap))
do_window(cap->nchar, cap->count0, NUL); /* everything is in window.c */
-#else
- (void)checkclearop(cap->oap);
-#endif
}
/*
case K_KHOME:
oap->motion_type = MCHAR;
oap->inclusive = FALSE;
- if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ if (curwin->w_p_wrap && curwin->w_width != 0)
{
int width1 = W_WIDTH(curwin) - curwin_col_off();
int width2 = width1 + curwin_col_off2();
oap->motion_type = MCHAR;
oap->inclusive = TRUE;
- if (curwin->w_p_wrap
-#ifdef FEAT_WINDOWS
- && curwin->w_width != 0
-#endif
- )
+ if (curwin->w_p_wrap && curwin->w_width != 0)
{
curwin->w_curswant = MAXCOL; /* so we stay at the end */
if (cap->count1 == 1)
break;
#endif
-#ifdef FEAT_WINDOWS
case 't':
if (!checkclearop(oap))
goto_tabpage((int)cap->count0);
if (!checkclearop(oap))
goto_tabpage(-(int)cap->count1);
break;
-#endif
case '+':
case '-': /* "g+" and "g-": undo or redo along the timeline */
#ifdef FEAT_LINEBREAK
# define PV_NUW OPT_WIN(WV_NUW)
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
# define PV_PVW OPT_WIN(WV_PVW)
#endif
#ifdef FEAT_RIGHTLEFT
# define PV_STL OPT_BOTH(OPT_WIN(WV_STL))
#endif
#define PV_UL OPT_BOTH(OPT_BUF(BV_UL))
-#ifdef FEAT_WINDOWS
# define PV_WFH OPT_WIN(WV_WFH)
# define PV_WFW OPT_WIN(WV_WFW)
-#endif
#define PV_WRAP OPT_WIN(WV_WRAP)
#ifdef FEAT_CURSORBIND
# define PV_CRBIND OPT_WIN(WV_CRBIND)
# define ISP_LATIN1 (char_u *)"@,161-255"
#endif
-/* Make the string as short as possible when compiling with few features. */
-#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
- || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
- || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) \
- || defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX) \
- || defined(FEAT_TERMINAL)
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC"
-#else
-# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
-#endif
/* Default python version for pyx* commands */
#if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
(char_u *)&p_dy, PV_NONE,
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"eadirection", "ead", P_STRING|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_ead, PV_NONE,
{(char_u *)"both", (char_u *)0L}
-#else
- (char_u *)NULL, PV_NONE,
- {(char_u *)NULL, (char_u *)0L}
-#endif
SCRIPTID_INIT},
{"edcompatible","ed", P_BOOL|P_VI_DEF,
(char_u *)&p_ed, PV_NONE,
#endif
SCRIPTID_INIT},
{"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP,
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
(char_u *)&p_fcs, PV_NONE,
{(char_u *)"vert:|,fold:-", (char_u *)0L}
-#else
- (char_u *)NULL, PV_NONE,
- {(char_u *)"", (char_u *)0L}
-#endif
SCRIPTID_INIT},
{"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT,
(char_u *)&p_fixeol, PV_FIXEOL,
{(char_u *)DFLT_HELPFILE, (char_u *)0L}
SCRIPTID_INIT},
{"helpheight", "hh", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_hh, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
{"helplang", "hlg", P_STRING|P_VI_DEF|P_ONECOMMA,
#ifdef FEAT_MULTI_LANG
#endif
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
-#ifdef FEAT_WINDOWS
(char_u *)&p_ls, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"lazyredraw", "lz", P_BOOL|P_VI_DEF,
(char_u *)&p_lz, PV_NONE,
(char_u *)&p_pi, PV_PI,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"previewheight", "pvh", P_NUM|P_VI_DEF,
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
(char_u *)&p_pvh, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)12L, (char_u *)0L} SCRIPTID_INIT},
{"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB,
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
(char_u *)VAR_WIN, PV_PVW,
#else
(char_u *)NULL, PV_NONE,
(char_u *)&p_smd, PV_NONE,
{(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
{"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL,
-#ifdef FEAT_WINDOWS
(char_u *)&p_stal, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"sidescroll", "ss", P_NUM|P_VI_DEF,
(char_u *)&p_ss, PV_NONE,
#endif
SCRIPTID_INIT},
{"splitbelow", "sb", P_BOOL|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_sb, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"splitright", "spr", P_BOOL|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_spr, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"startofline", "sol", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_sol, PV_NONE,
#endif
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"tabpagemax", "tpm", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_tpm, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)10L, (char_u *)0L} SCRIPTID_INIT},
{"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF,
(char_u *)&p_ts, PV_TS,
(char_u *)&p_window, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"winheight", "wh", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_wh, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT,
-#ifdef FEAT_WINDOWS
(char_u *)VAR_WIN, PV_WFH,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT,
-#ifdef FEAT_WINDOWS
(char_u *)VAR_WIN, PV_WFW,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"winminheight", "wmh", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_wmh, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"winminwidth", "wmw", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_wmw, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
{"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
#if defined(WIN3264) && defined(FEAT_TERMINAL)
#endif
SCRIPTID_INIT},
{"winwidth", "wiw", P_NUM|P_VI_DEF,
-#ifdef FEAT_WINDOWS
(char_u *)&p_wiw, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
{"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_WRAP,
p_term("t_CS", T_CCS)
p_term("t_Cs", T_UCS)
p_term("t_cs", T_CS)
-#ifdef FEAT_WINDOWS
p_term("t_CV", T_CSV)
-#endif
p_term("t_da", T_DA)
p_term("t_db", T_DB)
p_term("t_DL", T_CDL)
static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
#endif
static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
-#ifdef FEAT_WINDOWS
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
-#endif
#ifdef FEAT_AUTOCMD
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL};
#else
int opt_flags) /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
{
int i;
-#ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
-#endif
for (i = 0; !istermoption(&options[i]); i++)
if (!(options[i].flags & P_NODEFAULT)
)
set_option_default(i, opt_flags, p_cp);
-#ifdef FEAT_WINDOWS
/* The 'scroll' option must be computed for all windows. */
FOR_ALL_TAB_WINDOWS(tp, wp)
win_comp_scroll(wp);
-#else
- win_comp_scroll(curwin);
-#endif
#ifdef FEAT_CINDENT
parse_cino(curbuf);
#endif
check_opt_wim();
(void)set_chars_option(&p_lcs);
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
/* Parse default for 'fillchars'. */
(void)set_chars_option(&p_fcs);
-#endif
#ifdef FEAT_CLIPBOARD
/* Parse default for 'clipboard' */
static void redraw_titles(void)
{
need_maketitle = TRUE;
-# ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
-# endif
}
#endif
errmsg = e_invarg;
else if (set_chars_option(&p_lcs) != NULL)
errmsg = (char_u *)_("E834: Conflicts with value of 'listchars'");
-# if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
else if (set_chars_option(&p_fcs) != NULL)
errmsg = (char_u *)_("E835: Conflicts with value of 'fillchars'");
-# endif
}
#endif
set_iminsert_global();
set_imsearch_global();
}
-# ifdef FEAT_WINDOWS
status_redraw_curbuf();
-# endif
}
}
#endif
errmsg = set_chars_option(varp);
}
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
/* 'fillchars' */
else if (varp == &p_fcs)
{
errmsg = set_chars_option(varp);
}
-#endif
#ifdef FEAT_CMDWIN
/* 'cedit' */
}
-#ifdef FEAT_WINDOWS
/* 'eadirection' */
else if (varp == &p_ead)
{
if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK)
errmsg = e_invarg;
}
-#endif
#ifdef FEAT_CLIPBOARD
/* 'clipboard' */
errmsg = e_invarg;
else
{
-#ifdef FEAT_WINDOWS
if (curwin->w_status_height)
{
curwin->w_redr_status = TRUE;
redraw_later(VALID);
}
-#endif
curbuf->b_help = (curbuf->b_p_bt[0] == 'h');
#ifdef FEAT_TITLE
redraw_titles();
int *cp;
char *name;
};
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
static struct charstab filltab[] =
{
{&fill_stl, "stl"},
{&fill_fold, "fold"},
{&fill_diff, "diff"},
};
-#endif
static struct charstab lcstab[] =
{
{&lcs_eol, "eol"},
};
struct charstab *tab;
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
if (varp == &p_lcs)
-#endif
{
tab = lcstab;
entries = sizeof(lcstab) / sizeof(struct charstab);
}
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
else
{
tab = filltab;
entries = sizeof(filltab) / sizeof(struct charstab);
}
-#endif
/* first round: check for valid value, second round: assign values */
for (round = 0; round <= 1; ++round)
*(tab[i].cp) = (varp == &p_lcs ? NUL : ' ');
if (varp == &p_lcs)
lcs_tab1 = NUL;
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
else
fill_diff = '-';
-#endif
}
p = *varp;
while (*p)
if (wp->w_buffer == curbuf && wp->w_p_spell)
{
errmsg = did_set_spelllang(wp);
-# ifdef FEAT_WINDOWS
break;
-# endif
}
}
return errmsg;
}
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/* There can be only one window with 'previewwindow' set. */
else if ((int *)varp == &curwin->w_p_pvw)
{
curwin->w_leftcol = 0;
}
-#ifdef FEAT_WINDOWS
else if ((int *)varp == &p_ea)
{
if (p_ea && !old_value)
win_equal(curwin, FALSE, 0);
}
-#endif
else if ((int *)varp == &p_wiv)
{
/*
* Number options that need some action when changed
*/
-#ifdef FEAT_WINDOWS
if (pp == &p_wh || pp == &p_hh)
{
if (p_wh < 1)
}
win_setminheight();
}
-
-# ifdef FEAT_WINDOWS
else if (pp == &p_wiw)
{
if (p_wiw < 1)
}
win_setminheight();
}
-# endif
-
-#endif
-#ifdef FEAT_WINDOWS
/* (re)set last window status line */
else if (pp == &p_ls)
{
{
shell_new_rows(); /* recompute window positions and heights */
}
-#endif
#ifdef FEAT_GUI
else if (pp == &p_linespace)
p_iminsert = curbuf->b_p_iminsert;
if (termcap_active) /* don't do this in the alternate screen */
showmode();
-#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+#if defined(FEAT_KEYMAP)
/* Show/unshow value of 'keymap' in status lines. */
status_redraw_curbuf();
#endif
curbuf->b_p_tw = 0;
}
#ifdef FEAT_SYN_HL
-# ifdef FEAT_WINDOWS
{
win_T *wp;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, wp)
check_colorcolumn(wp);
}
-# else
- check_colorcolumn(curwin);
-# endif
#endif
}
int doclear = (flags & P_RCLR) == P_RCLR;
int all = ((flags & P_RALL) == P_RALL || doclear);
-#ifdef FEAT_WINDOWS
if ((flags & P_RSTAT) || all) /* mark all status lines dirty */
status_redraw_all();
-#endif
if ((flags & P_RBUF) || (flags & P_RWIN) || all)
changed_window_setting();
void
comp_col(void)
{
-#if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS)
+#if defined(FEAT_CMDL_INFO)
int last_has_status = (p_ls == 2 || (p_ls == 1 && !ONE_WINDOW));
sc_col = 0;
ru_col = 0;
if (p_ru)
{
-#ifdef FEAT_STL_OPT
+# ifdef FEAT_STL_OPT
ru_col = (ru_wid ? ru_wid : COL_RULER) + 1;
-#else
+# else
ru_col = COL_RULER + 1;
-#endif
+# endif
/* no last status line, adjust sc_col */
if (!last_has_status)
sc_col = ru_col;
#ifdef FEAT_LINEBREAK
case PV_NUW: return (char_u *)&(curwin->w_p_nuw);
#endif
-#ifdef FEAT_WINDOWS
case PV_WFH: return (char_u *)&(curwin->w_p_wfh);
case PV_WFW: return (char_u *)&(curwin->w_p_wfw);
-#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
case PV_PVW: return (char_u *)&(curwin->w_p_pvw);
#endif
#ifdef FEAT_RIGHTLEFT
return curbuf->b_p_ep;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Copy options from one window to another.
* Used when splitting a window.
briopt_check(wp_to);
#endif
}
-#endif
/*
* Copy the options from one winopt_T to another.
p_sm = 0; /* no showmatch */
p_sta = 0; /* no smarttab */
#ifdef FEAT_CMDL_INFO
-# ifdef FEAT_WINDOWS
if (p_ru)
status_redraw_all(); /* redraw to remove the ruler */
-# endif
p_ru = 0; /* no ruler */
#endif
#ifdef FEAT_RIGHTLEFT
p_sm = save_sm;
p_sta = save_sta;
#ifdef FEAT_CMDL_INFO
-# ifdef FEAT_WINDOWS
if (p_ru != save_ru)
status_redraw_all(); /* redraw to draw the ruler */
-# endif
p_ru = save_ru;
#endif
#ifdef FEAT_RIGHTLEFT
#define DY_TRUNCATE 0x002
#define DY_UHEX 0x004
EXTERN int p_ed; /* 'edcompatible' */
-#ifdef FEAT_WINDOWS
EXTERN char_u *p_ead; /* 'eadirection' */
-#endif
EXTERN int p_ea; /* 'equalalways' */
EXTERN char_u *p_ep; /* 'equalprg' */
EXTERN int p_eb; /* 'errorbells' */
EXTERN char_u *p_gtt; /* 'guitabtooltip' */
#endif
EXTERN char_u *p_hf; /* 'helpfile' */
-#ifdef FEAT_WINDOWS
EXTERN long p_hh; /* 'helpheight' */
-#endif
#ifdef FEAT_MULTI_LANG
EXTERN char_u *p_hlg; /* 'helplang' */
#endif
#ifdef FEAT_LISP
EXTERN char_u *p_lispwords; /* 'lispwords' */
#endif
-#ifdef FEAT_WINDOWS
EXTERN long p_ls; /* 'laststatus' */
EXTERN long p_stal; /* 'showtabline' */
-#endif
EXTERN char_u *p_lcs; /* 'listchars' */
EXTERN int p_lz; /* 'lazyredraw' */
EXTERN char_u *p_rop; /* 'renderoptions' */
#endif
EXTERN long p_report; /* 'report' */
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
EXTERN long p_pvh; /* 'previewheight' */
#endif
#ifdef WIN3264
EXTERN long p_siso; /* 'sidescrolloff' */
EXTERN int p_scs; /* 'smartcase' */
EXTERN int p_sta; /* 'smarttab' */
-#ifdef FEAT_WINDOWS
EXTERN int p_sb; /* 'splitbelow' */
EXTERN long p_tpm; /* 'tabpagemax' */
# if defined(FEAT_STL_OPT)
EXTERN char_u *p_tal; /* 'tabline' */
# endif
-#endif
#ifdef FEAT_SPELL
EXTERN char_u *p_sps; /* 'spellsuggest' */
#endif
-#ifdef FEAT_WINDOWS
EXTERN int p_spr; /* 'splitright' */
-#endif
EXTERN int p_sol; /* 'startofline' */
EXTERN char_u *p_su; /* 'suffixes' */
EXTERN char_u *p_sws; /* 'swapsync' */
EXTERN long p_ur; /* 'undoreload' */
EXTERN long p_uc; /* 'updatecount' */
EXTERN long p_ut; /* 'updatetime' */
-#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
EXTERN char_u *p_fcs; /* 'fillchar' */
-#endif
#ifdef FEAT_VIMINFO
EXTERN char_u *p_viminfo; /* 'viminfo' */
EXTERN char_u *p_viminfofile; /* 'viminfofile' */
#ifdef FEAT_WILDMENU
EXTERN int p_wmnu; /* 'wildmenu' */
#endif
-#ifdef FEAT_WINDOWS
EXTERN long p_wh; /* 'winheight' */
EXTERN long p_wmh; /* 'winminheight' */
EXTERN long p_wmw; /* 'winminwidth' */
EXTERN long p_wiw; /* 'winwidth' */
-#endif
#if defined(WIN3264) && defined(FEAT_TERMINAL)
EXTERN char_u *p_winptydll; /* 'winptydll' */
#endif
#ifdef FEAT_LINEBREAK
, WV_NUW
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
, WV_PVW
#endif
#ifdef FEAT_RIGHTLEFT
#ifdef FEAT_STL_OPT
, WV_STL
#endif
-#ifdef FEAT_WINDOWS
, WV_WFH
, WV_WFW
-#endif
, WV_WRAP
#ifdef FEAT_SIGNS
, WV_SCL
int above_row;
int below_row;
int redo_count = 0;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
win_T *pvwin;
#endif
row = curwin->w_wrow + W_WINROW(curwin);
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
FOR_ALL_WINDOWS(pvwin)
if (pvwin->w_p_pvw)
break;
if (pum_height < 1 || (pum_height == 1 && size > 1))
return;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/* If there is a preview window at the above avoid drawing over it. */
if (pvwin != NULL && pum_row < above_row && pum_height > above_row)
{
}
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/*
* Show extra info in the preview window if there is something and
* 'completeopt' contains "preview".
{
pum_array = NULL;
redraw_all_later(SOME_VALID);
-#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
-#endif
status_redraw_all();
}
static char_u *qf_guess_filepath(qf_info_T *qi, int qf_idx, char_u *);
static void qf_fmt_text(char_u *text, char_u *buf, int bufsize);
static void qf_clean_dir_stack(struct dir_stack_T **);
-#ifdef FEAT_WINDOWS
static int qf_win_pos_update(qf_info_T *qi, int old_qf_index);
static int is_qf_win(win_T *win, qf_info_T *qi);
static win_T *qf_find_win(qf_info_T *qi);
static void qf_update_buffer(qf_info_T *qi, qfline_T *old_last);
static void qf_set_title_var(qf_info_T *qi);
static void qf_fill_buffer(qf_info_T *qi, buf_T *buf, qfline_T *old_last);
-#endif
static char_u *get_mef_name(void);
static void restore_start_dir(char_u *dirname_start);
static buf_T *load_dummy_buffer(char_u *fname, char_u *dirname_start, char_u *resulting_dir);
qf_list_T *qfl;
qfstate_T state;
qffields_T fields;
-#ifdef FEAT_WINDOWS
qfline_T *old_last = NULL;
-#endif
int adding = FALSE;
static efm_T *fmt_first = NULL;
char_u *efm;
{
/* Adding to existing list, use last entry. */
adding = TRUE;
-#ifdef FEAT_WINDOWS
if (qi->qf_lists[qf_idx].qf_count > 0)
old_last = qi->qf_lists[qf_idx].qf_last;
-#endif
}
qfl = &qi->qf_lists[qf_idx];
vim_free(fields.pattern);
vim_free(state.growbuf);
-#ifdef FEAT_WINDOWS
if (qf_idx == qi->qf_curlist)
qf_update_buffer(qi, old_last);
-#endif
#ifdef FEAT_MBYTE
if (state.vc.vc_type != CONV_NONE)
convert_setup(&state.vc, NULL, NULL);
return qf_ptr;
}
-#ifdef FEAT_WINDOWS
/*
* Find a help window or open one.
*/
return OK;
}
-#endif
/*
* jump to a quickfix line
colnr_T screen_col;
colnr_T char_col;
char_u *line;
-#ifdef FEAT_WINDOWS
char_u *old_swb = p_swb;
unsigned old_swb_flags = swb_flags;
int opened_window = FALSE;
win_T *win;
win_T *altwin;
int flags;
-#endif
win_T *oldwin = curwin;
int print_message = TRUE;
int len;
else if (errornr != 0) /* go to specified number */
qf_ptr = get_nth_entry(qi, errornr, qf_ptr, &qf_index);
-#ifdef FEAT_WINDOWS
qi->qf_lists[qi->qf_curlist].qf_index = qf_index;
if (qf_win_pos_update(qi, old_qf_index))
/* No need to print the error message if it's visible in the error
}
}
}
-#endif
/*
* If there is a file name,
}
else
{
-#ifdef FEAT_WINDOWS
if (opened_window)
win_close(curwin, TRUE); /* Close opened window */
-#endif
if (qf_ptr != NULL && qf_ptr->qf_fnum != 0)
{
/*
* Couldn't open file, so put index back where it was. This could
* happen if the file was readonly and we changed something.
*/
-#ifdef FEAT_WINDOWS
failed:
-#endif
qf_ptr = old_qf_ptr;
qf_index = old_qf_index;
}
qi->qf_lists[qi->qf_curlist].qf_ptr = qf_ptr;
qi->qf_lists[qi->qf_curlist].qf_index = qf_index;
}
-#ifdef FEAT_WINDOWS
if (p_swb != old_swb && opened_window)
{
/* Restore old 'switchbuf' value, but not when an autocommand or
else
free_string_option(old_swb);
}
-#endif
}
/*
}
}
qf_msg(qi, qi->qf_curlist, "");
-#ifdef FEAT_WINDOWS
qf_update_buffer(qi, NULL);
-#endif
}
void
return buf;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* ":cwindow": open the quickfix window if we have errors to display,
* close it if not.
KeyTyped = old_KeyTyped;
}
-#endif /* FEAT_WINDOWS */
-
/*
* Return TRUE when using ":vimgrep" for ":grep".
*/
qi->qf_lists[qi->qf_curlist].qf_ptr = qi->qf_lists[qi->qf_curlist].qf_start;
qi->qf_lists[qi->qf_curlist].qf_index = 1;
-#ifdef FEAT_WINDOWS
qf_update_buffer(qi, NULL);
-#endif
#ifdef FEAT_AUTOCMD
if (au_name != NULL)
long lnum;
int col, nr;
int vcol;
-#ifdef FEAT_WINDOWS
qfline_T *old_last = NULL;
-#endif
int valid, status;
int retval = OK;
int did_bufnr_emsg = FALSE;
qf_new_list(qi, title);
qf_idx = qi->qf_curlist;
}
-#ifdef FEAT_WINDOWS
else if (action == 'a' && qi->qf_lists[qf_idx].qf_count > 0)
/* Adding to existing list, use last entry. */
old_last = qi->qf_lists[qf_idx].qf_last;
-#endif
else if (action == 'r')
{
qf_free_items(qi, qf_idx);
qi->qf_lists[qf_idx].qf_index = 1;
}
-#ifdef FEAT_WINDOWS
/* Don't update the cursor in quickfix window when appending entries */
qf_update_buffer(qi, old_last);
-#endif
return retval;
}
/* Darn, some plugin changed the value. */
free_string_option(save_cpo);
-#ifdef FEAT_WINDOWS
qf_update_buffer(qi, NULL);
-#endif
#ifdef FEAT_AUTOCMD
if (au_name != NULL)
#endif
static int win_line(win_T *, linenr_T, int, int, int nochange, proftime_T *syntax_tm);
static int char_needs_redraw(int off_from, int off_to, int cols);
-#ifdef FEAT_WINDOWS
static void draw_vsep_win(win_T *wp, int row);
-#endif
#ifdef FEAT_STL_OPT
static void redraw_custom_statusline(win_T *wp);
#endif
static void screenclear2(void);
static void lineclear(unsigned off, int width, int attr);
static void lineinvalid(unsigned off, int width);
-#ifdef FEAT_WINDOWS
static void linecopy(int to, int from, win_T *wp);
static void redraw_block(int row, int end, win_T *wp);
-#endif
static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int del, int clear_attr);
static void win_rest_invalid(win_T *wp);
static void msg_pos_mode(void);
static void recording_mode(int attr);
-#if defined(FEAT_WINDOWS)
static void draw_tabline(void);
-#endif
-#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
static int fillchar_status(int *attr, win_T *wp);
-#endif
-#ifdef FEAT_WINDOWS
static int fillchar_vsep(int *attr);
-#endif
#ifdef FEAT_STL_OPT
static void win_redr_custom(win_T *wp, int draw_ruler);
#endif
static void win_redr_ruler(win_T *wp, int always);
#endif
-#if defined(FEAT_CLIPBOARD) || defined(FEAT_WINDOWS)
/* Ugly global: overrule attribute used by screen_char() */
static int screen_char_attr = 0;
-#endif
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
/* Can limit syntax highlight time to 'redrawtime'. */
if (wp->w_buffer == buf)
{
redraw_win_later(wp, type);
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
-#endif
}
}
}
else
{
wp->w_redr_type = NOT_VALID;
-#ifdef FEAT_WINDOWS
if (W_WINROW(wp) + wp->w_height + W_STATUS_HEIGHT(wp)
<= msg_scrolled)
wp->w_redr_status = TRUE;
-#endif
}
}
}
if (!no_update)
redraw_cmdline = TRUE;
-#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
-#endif
}
msg_scrolled = 0;
need_wait_return = FALSE;
))
curwin->w_redr_type = type;
-#ifdef FEAT_WINDOWS
/* Redraw the tab pages line if needed. */
if (redraw_tabline || type >= NOT_VALID)
draw_tabline();
-#endif
#ifdef FEAT_SYN_HL
/*
{
if (wp->w_buffer->b_mod_set)
{
-# ifdef FEAT_WINDOWS
win_T *wwp;
/* Check if we already did this buffer. */
for (wwp = firstwin; wwp != wp; wwp = wwp->w_next)
if (wwp->w_buffer == wp->w_buffer)
break;
-# endif
- if (
-# ifdef FEAT_WINDOWS
- wwp == wp &&
-# endif
- syntax_present(wp))
+ if (wwp == wp && syntax_present(wp))
syn_stack_apply_changes(wp->w_buffer);
}
}
win_update(wp);
}
-#ifdef FEAT_WINDOWS
/* redraw status line after the window to minimize cursor movement */
if (wp->w_redr_status)
{
cursor_off();
win_redr_status(wp);
}
-#endif
}
#if defined(FEAT_SEARCH_EXTRA)
end_search_hl();
pum_redraw();
#endif
-#ifdef FEAT_WINDOWS
/* Reset b_mod_set flags. Going through all windows is probably faster
* than going through all buffers (there could be many buffers). */
FOR_ALL_WINDOWS(wp)
wp->w_buffer->b_mod_set = FALSE;
-#else
- curbuf->b_mod_set = FALSE;
-#endif
updating_screen = FALSE;
#ifdef FEAT_GUI
/* update all windows that need updating */
update_prepare();
-# ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(wp)
{
if (wp->w_redr_type != 0)
if (wp->w_redr_status)
win_redr_status(wp);
}
-# else
- if (curwin->w_redr_type != 0)
- win_update(curwin);
-# endif
update_finish();
}
win_update(wp);
-#ifdef FEAT_WINDOWS
/* When the screen was cleared redraw the tab pages line. */
if (redraw_tabline)
draw_tabline();
# endif
)
win_redr_status(wp);
-#endif
update_finish();
}
if (type == NOT_VALID)
{
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
-#endif
wp->w_lines_valid = 0;
}
return;
}
-#ifdef FEAT_WINDOWS
/* Window is zero-width: Only need to draw the separator. */
if (wp->w_width == 0)
{
wp->w_redr_type = 0;
return;
}
-#endif
#ifdef FEAT_TERMINAL
/* If this window contains a terminal, redraw works completely differently.
* then. */
if (screen_cleared != TRUE)
screenclear();
-#ifdef FEAT_WINDOWS
/* The screen was cleared, redraw the tab pages line. */
if (redraw_tabline)
draw_tabline();
-#endif
}
}
}
else
{
-#ifdef FEAT_WINDOWS
draw_vsep_win(wp, row);
-#endif
if (eof) /* we hit the end of the file */
{
wp->w_botline = buf->b_ml.ml_line_count + 1;
int need_showbreak = FALSE; /* overlong line, skipping first x
chars */
#endif
-#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
+#if defined(FEAT_SIGNS) || defined(FEAT_QUICKFIX) \
|| defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
# define LINE_ATTR
int line_attr = 0; /* attribute for the whole line */
if (v != 0)
line_attr = sign_get_attr((int)v, TRUE);
# endif
-# if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+# if defined(FEAT_QUICKFIX)
/* Highlight the current line in the quickfix window. */
if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum)
line_attr = HL_ATTR(HLF_QFL);
)
{
win_draw_end(wp, '@', ' ', row, wp->w_height, HLF_AT);
-#ifdef FEAT_WINDOWS
draw_vsep_win(wp, row);
-#endif
row = endrow;
}
#ifdef FEAT_DIFF
&& filler_todo <= 0
#endif
-#ifdef FEAT_WINDOWS
- && W_WIDTH(wp) == Columns
-#endif
- )
+ && W_WIDTH(wp) == Columns)
{
/* Remember that the line wraps, used for modeless copy. */
LineWraps[screen_row - 1] = TRUE;
unsigned max_off_to;
#endif
int col = 0;
-#if defined(FEAT_GUI) || defined(UNIX) || defined(FEAT_WINDOWS)
int hl;
-#endif
int force = FALSE; /* force update rest of the line */
int redraw_this /* bool: does character need redraw? */
#ifdef FEAT_GUI
#endif
screen_fill(row, row + 1, col + coloff, clear_width + coloff,
' ', ' ', 0);
-#ifdef FEAT_WINDOWS
off_to += clear_width - col;
col = clear_width;
-#endif
}
}
if (clear_width > 0)
{
-#ifdef FEAT_WINDOWS
/* For a window that's left of another, draw the separator char. */
if (col + coloff < Columns)
{
c = fillchar_vsep(&hl);
if (ScreenLines[off_to] != (schar_T)c
-# ifdef FEAT_MBYTE
+#ifdef FEAT_MBYTE
|| (enc_utf8 && (int)ScreenLinesUC[off_to]
!= (c >= 0x80 ? c : 0))
-# endif
+#endif
|| ScreenAttrs[off_to] != hl)
{
ScreenLines[off_to] = c;
ScreenAttrs[off_to] = hl;
-# ifdef FEAT_MBYTE
+#ifdef FEAT_MBYTE
if (enc_utf8)
{
if (c >= 0x80)
else
ScreenLinesUC[off_to] = 0;
}
-# endif
+#endif
screen_char(off_to, row, col + coloff);
}
}
else
-#endif
LineWraps[row] = FALSE;
}
}
}
#endif
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* mark all status lines for redraw; used after first :cd
*/
if (redraw_tabline)
draw_tabline();
}
-#endif
-#if (defined(FEAT_WILDMENU) && defined(FEAT_WINDOWS)) || defined(PROTO)
+#if defined(FEAT_WILDMENU) || defined(PROTO)
/*
* Redraw all status lines at the bottom of frame "frp".
*/
}
#endif
-#ifdef FEAT_WINDOWS
/*
* Draw the verticap separator right of window "wp" starting with line "row".
*/
c, ' ', hl);
}
}
-#endif
#ifdef FEAT_WILDMENU
static int status_match_len(expand_T *xp, char_u *s);
screen_fill(row, row + 1, clen, (int)Columns, fillchar, fillchar, attr);
}
-#ifdef FEAT_WINDOWS
win_redraw_last_status(topframe);
-#else
- lastwin->w_redr_status = TRUE;
-#endif
vim_free(buf);
}
#endif
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Redraw the status line of window wp.
*
return FALSE;
}
-#endif /* FEAT_WINDOWS */
-#if defined(FEAT_WINDOWS) || defined(FEAT_STL_OPT) || defined(PROTO)
/*
* Get the value to show for the language mappings, active 'keymap'.
*/
}
return buf[0] != NUL;
}
-#endif
#if defined(FEAT_STL_OPT) || defined(PROTO)
/*
if (*stl++ != '(')
stl = p_ruf;
}
-#ifdef FEAT_WINDOWS
col = ru_col - (Columns - W_WIDTH(wp));
if (col < (W_WIDTH(wp) + 1) / 2)
col = (W_WIDTH(wp) + 1) / 2;
-#else
- col = ru_col;
- if (col > (Columns + 1) / 2)
- col = (Columns + 1) / 2;
-#endif
maxwidth = W_WIDTH(wp) - col;
-#ifdef FEAT_WINDOWS
if (!wp->w_status_height)
-#endif
{
row = Rows - 1;
--maxwidth; /* writing in last column may cause scrolling */
# endif
}
-#ifdef FEAT_WINDOWS
col += W_WINCOL(wp);
-#endif
}
if (maxwidth <= 0)
curattr = attr;
else if (hltab[n].userhl < 0)
curattr = syn_id2attr(-hltab[n].userhl);
-#ifdef FEAT_WINDOWS
-# ifdef FEAT_TERMINAL
+#ifdef FEAT_TERMINAL
else if (wp != NULL && wp != curwin && bt_terminal(wp->w_buffer)
&& wp->w_status_height != 0)
curattr = highlight_stltermnc[hltab[n].userhl - 1];
else if (wp != NULL && bt_terminal(wp->w_buffer)
&& wp->w_status_height != 0)
curattr = highlight_stlterm[hltab[n].userhl - 1];
-# endif
+#endif
else if (wp != NULL && wp != curwin && wp->w_status_height != 0)
curattr = highlight_stlnc[hltab[n].userhl - 1];
-#endif
else
curattr = highlight_user[hltab[n].userhl - 1];
}
/*
* Stop highlighting first, so it's easier to move the cursor.
*/
-#if defined(FEAT_CLIPBOARD) || defined(FEAT_WINDOWS)
if (screen_char_attr != 0)
attr = screen_char_attr;
else
-#endif
attr = ScreenAttrs[off];
if (screen_attr != attr)
screen_stop_highlight();
}
#endif
-#if defined(FEAT_CLIPBOARD) || defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Draw a rectangle of the screen, inverted when "invert" is TRUE.
* This uses the contents of ScreenLines[] and doesn't change it.
}
screen_char_attr = 0;
}
-#endif
-#ifdef FEAT_WINDOWS
/*
* Redraw the characters for a vertically split window.
*/
}
screen_draw_rectangle(row, col, end - row, width, FALSE);
}
-#endif
/*
* Fill the screen from 'start_row' to 'end_row', from 'start_col' to 'end_col'
sattr_T *new_ScreenAttrs;
unsigned *new_LineOffset;
char_u *new_LineWraps;
-#ifdef FEAT_WINDOWS
short *new_TabPageIdxs;
tabpage_T *tp;
-#endif
static int entered = FALSE; /* avoid recursiveness */
static int done_outofmem_msg = FALSE; /* did outofmem message */
#ifdef FEAT_AUTOCMD
new_LineOffset = (unsigned *)lalloc((long_u)(
Rows * sizeof(unsigned)), FALSE);
new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE);
-#ifdef FEAT_WINDOWS
new_TabPageIdxs = (short *)lalloc((long_u)(Columns * sizeof(short)), FALSE);
-#endif
FOR_ALL_TAB_WINDOWS(tp, wp)
{
if (win_alloc_lines(wp) == FAIL)
{
outofmem = TRUE;
-#ifdef FEAT_WINDOWS
goto give_up;
-#endif
}
}
#ifdef FEAT_AUTOCMD
&& win_alloc_lines(aucmd_win) == FAIL)
outofmem = TRUE;
#endif
-#ifdef FEAT_WINDOWS
give_up:
-#endif
#ifdef FEAT_MBYTE
for (i = 0; i < p_mco; ++i)
|| new_ScreenAttrs == NULL
|| new_LineOffset == NULL
|| new_LineWraps == NULL
-#ifdef FEAT_WINDOWS
|| new_TabPageIdxs == NULL
-#endif
|| outofmem)
{
if (ScreenLines != NULL || !done_outofmem_msg)
new_LineOffset = NULL;
vim_free(new_LineWraps);
new_LineWraps = NULL;
-#ifdef FEAT_WINDOWS
vim_free(new_TabPageIdxs);
new_TabPageIdxs = NULL;
-#endif
}
else
{
ScreenAttrs = new_ScreenAttrs;
LineOffset = new_LineOffset;
LineWraps = new_LineWraps;
-#ifdef FEAT_WINDOWS
TabPageIdxs = new_TabPageIdxs;
-#endif
/* It's important that screen_Rows and screen_Columns reflect the actual
* size of ScreenLines[]. Set them before calling anything. */
vim_free(ScreenAttrs);
vim_free(LineOffset);
vim_free(LineWraps);
-#ifdef FEAT_WINDOWS
vim_free(TabPageIdxs);
-#endif
}
void
win_rest_invalid(firstwin);
redraw_cmdline = TRUE;
-#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
-#endif
if (must_redraw == CLEAR) /* no need to clear again */
must_redraw = NOT_VALID;
compute_cmdrow();
(void)vim_memset(ScreenAttrs + off, -1, (size_t)width * sizeof(sattr_T));
}
-#ifdef FEAT_WINDOWS
/*
* Copy part of a Screenline for vertically split window "wp".
*/
mch_memmove(ScreenLines + off_to, ScreenLines + off_from,
wp->w_width * sizeof(schar_T));
-# ifdef FEAT_MBYTE
+#ifdef FEAT_MBYTE
if (enc_utf8)
{
int i;
if (enc_dbcs == DBCS_JPNU)
mch_memmove(ScreenLines2 + off_to, ScreenLines2 + off_from,
wp->w_width * sizeof(schar_T));
-# endif
+#endif
mch_memmove(ScreenAttrs + off_to, ScreenAttrs + off_from,
wp->w_width * sizeof(sattr_T));
}
-#endif
/*
* Return TRUE if clearing with term string "p" would work.
* messing up those windows, better just redraw.
*/
did_delete = FALSE;
-#ifdef FEAT_WINDOWS
if (wp->w_next != NULL || wp->w_status_height)
{
if (screen_del_lines(0, W_WINROW(wp) + wp->w_height - line_count,
else if (wp->w_next)
return FAIL;
}
-#endif
/*
* if no lines deleted, blank the lines that will end up below the window
*/
if (!did_delete)
{
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
-#endif
redraw_cmdline = TRUE;
nextrow = W_WINROW(wp) + wp->w_height + W_STATUS_HEIGHT(wp);
lastrow = nextrow + line_count;
/* deletion will have messed up other windows */
if (did_delete)
{
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
-#endif
win_rest_invalid(W_NEXT(wp));
}
return FAIL;
(int)Rows, FALSE, clear_attr, NULL) == FAIL)
return FAIL;
-#ifdef FEAT_WINDOWS
/*
* If there are windows or status lines below, try to put them at the
* correct place. If we can't do that, they have to be redrawn.
* command line later.
*/
else
-#endif
redraw_cmdline = TRUE;
return OK;
}
return FAIL;
/* only a few lines left: redraw is faster */
- if (mayclear && Rows - line_count < 5
-#ifdef FEAT_WINDOWS
- && wp->w_width == Columns
-#endif
- )
+ if (mayclear && Rows - line_count < 5 && wp->w_width == Columns)
{
if (!no_win_do_lines_ins)
screenclear(); /* will set wp->w_lines_valid to 0 */
* a character in the lower right corner of the scroll region may cause a
* scroll-up .
*/
- if (scroll_region
-#ifdef FEAT_WINDOWS
- || W_WIDTH(wp) != Columns
-#endif
- )
+ if (scroll_region || W_WIDTH(wp) != Columns)
{
-#ifdef FEAT_WINDOWS
if (scroll_region && (wp->w_width == Columns || *T_CSV != NUL))
-#endif
scroll_region_set(wp, row);
if (del)
retval = screen_del_lines(W_WINROW(wp) + row, 0, line_count,
else
retval = screen_ins_lines(W_WINROW(wp) + row, 0, line_count,
wp->w_height - row, clear_attr, wp);
-#ifdef FEAT_WINDOWS
if (scroll_region && (wp->w_width == Columns || *T_CSV != NUL))
-#endif
scroll_region_reset();
return retval;
}
-#ifdef FEAT_WINDOWS
if (wp->w_next != NULL && p_tf) /* don't delete/insert on fast terminal */
return FAIL;
-#endif
return MAYBE;
}
static void
win_rest_invalid(win_T *wp)
{
-#ifdef FEAT_WINDOWS
while (wp != NULL)
-#else
- if (wp != NULL)
-#endif
{
redraw_win_later(wp, NOT_VALID);
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
wp = wp->w_next;
-#endif
}
redraw_cmdline = TRUE;
}
* exists.
*/
result_empty = (row + line_count >= end);
-#ifdef FEAT_WINDOWS
if (wp != NULL && wp->w_width != Columns && *T_CSV == NUL)
type = USE_REDRAW;
- else
-#endif
- if (can_clear(T_CD) && result_empty)
+ else if (can_clear(T_CD) && result_empty)
type = USE_T_CD;
else if (*T_CAL != NUL && (line_count > 1 || *T_AL == NUL))
type = USE_T_CAL;
#ifdef FEAT_CLIPBOARD
/* Remove a modeless selection when inserting lines halfway the screen
* or not the full width of the screen. */
- if (off + row > 0
-# ifdef FEAT_WINDOWS
- || (wp != NULL && wp->w_width != Columns)
-# endif
- )
+ if (off + row > 0 || (wp != NULL && wp->w_width != Columns))
clip_clear_selection(&clip_star);
else
clip_scroll_selection(-line_count);
end += off;
for (i = 0; i < line_count; ++i)
{
-#ifdef FEAT_WINDOWS
if (wp != NULL && wp->w_width != Columns)
{
/* need to copy part of a line */
LineWraps[j] = FALSE;
}
else
-#endif
{
j = end - 1 - i;
temp = LineOffset[j];
if (clear_attr != 0)
screen_start_highlight(clear_attr);
-#ifdef FEAT_WINDOWS
/* redraw the characters */
if (type == USE_REDRAW)
redraw_block(row, end, wp);
- else
-#endif
- if (type == USE_T_CAL)
+ else if (type == USE_T_CAL)
{
term_append_lines(line_count);
screen_start(); /* don't know where cursor is now */
* 5. Use T_DL (delete line) if it exists.
* 6. redraw the characters from ScreenLines[].
*/
-#ifdef FEAT_WINDOWS
if (wp != NULL && wp->w_width != Columns && *T_CSV == NUL)
type = USE_REDRAW;
- else
-#endif
- if (can_clear(T_CD) && result_empty)
+ else if (can_clear(T_CD) && result_empty)
type = USE_T_CD;
#if defined(__BEOS__) && defined(BEOS_DR8)
/*
else if (*T_CDL != NUL && line_count > 1 && can_delete)
type = USE_T_CDL;
else if (can_clear(T_CE) && result_empty
-#ifdef FEAT_WINDOWS
- && (wp == NULL || wp->w_width == Columns)
-#endif
- )
+ && (wp == NULL || wp->w_width == Columns))
type = USE_T_CE;
else if (*T_DL != NUL && can_delete)
type = USE_T_DL;
#ifdef FEAT_CLIPBOARD
/* Remove a modeless selection when deleting lines halfway the screen or
* not the full width of the screen. */
- if (off + row > 0
-# ifdef FEAT_WINDOWS
- || (wp != NULL && wp->w_width != Columns)
-# endif
- )
+ if (off + row > 0 || (wp != NULL && wp->w_width != Columns))
clip_clear_selection(&clip_star);
else
clip_scroll_selection(line_count);
end += off;
for (i = 0; i < line_count; ++i)
{
-#ifdef FEAT_WINDOWS
if (wp != NULL && wp->w_width != Columns)
{
/* need to copy part of a line */
LineWraps[j] = FALSE;
}
else
-#endif
{
/* whole width, moving the line pointers is faster */
j = row + i;
if (clear_attr != 0)
screen_start_highlight(clear_attr);
-#ifdef FEAT_WINDOWS
/* redraw the characters */
if (type == USE_REDRAW)
redraw_block(row, end, wp);
- else
-#endif
- if (type == USE_T_CD) /* delete the lines */
+ else if (type == USE_T_CD) /* delete the lines */
{
windgoto(cursor_row, 0);
out_str(T_CD);
/* If the last window has no status line, the ruler is after the mode
* message and must be redrawn */
- if (redrawing()
-# ifdef FEAT_WINDOWS
- && lastwin->w_status_height == 0
-# endif
- )
+ if (redrawing() && lastwin->w_status_height == 0)
win_redr_ruler(lastwin, TRUE);
#endif
redraw_cmdline = FALSE;
}
}
-#if defined(FEAT_WINDOWS)
/*
* Draw the tab pages line at the top of the Vim window.
*/
home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE);
trans_characters(NameBuff, MAXPATHL);
}
-#endif
-#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
/*
* Get the character to use in a status line. Get its attributes in "*attr".
*/
return '^';
return '=';
}
-#endif
-#ifdef FEAT_WINDOWS
/*
* Get the character to use in a separator between vertically split windows.
* Get its attributes in "*attr".
else
return fill_vert;
}
-#endif
/*
* Return TRUE if redrawing should currently be done.
#ifdef FEAT_INS_EXPAND
if (pum_visible())
{
-# ifdef FEAT_WINDOWS
/* Don't redraw right now, do it later. */
curwin->w_redr_status = TRUE;
-# endif
return;
}
#endif
-#if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
+#if defined(FEAT_STL_OPT)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
{
redraw_custom_statusline(curwin);
)
maketitle();
#endif
-#ifdef FEAT_WINDOWS
/* Redraw the tab pages line if needed. */
if (redraw_tabline)
draw_tabline();
-#endif
}
#ifdef FEAT_CMDL_INFO
int i;
size_t len;
int o;
-#ifdef FEAT_WINDOWS
int this_ru_col;
int off = 0;
int width = Columns;
-# define WITH_OFF(x) x
-# define WITH_WIDTH(x) x
-#else
-# define WITH_OFF(x) 0
-# define WITH_WIDTH(x) Columns
-# define this_ru_col ru_col
-#endif
/* If 'ruler' off or redrawing disabled, don't do anything */
if (!p_ru)
#ifdef FEAT_INS_EXPAND
/* Don't draw the ruler while doing insert-completion, it might overwrite
* the (long) mode message. */
-# ifdef FEAT_WINDOWS
if (wp == lastwin && lastwin->w_status_height == 0)
-# endif
if (edit_submode != NULL)
return;
/* Don't draw the ruler when the popup menu is visible, it may overlap. */
|| empty_line != wp->w_ru_empty)
{
cursor_off();
-#ifdef FEAT_WINDOWS
if (wp->w_status_height)
{
row = W_WINROW(wp) + wp->w_height;
width = W_WIDTH(wp);
}
else
-#endif
{
row = Rows - 1;
fillchar = ' ';
attr = 0;
-#ifdef FEAT_WINDOWS
width = Columns;
off = 0;
-#endif
}
/* In list mode virtcol needs to be recomputed */
i = (int)STRLEN(buffer);
get_rel_pos(wp, buffer + i + 1, RULER_BUF_LEN - i - 1);
o = i + vim_strsize(buffer + i + 1);
-#ifdef FEAT_WINDOWS
if (wp->w_status_height == 0) /* can't use last char of screen */
-#endif
++o;
-#ifdef FEAT_WINDOWS
this_ru_col = ru_col - (Columns - width);
if (this_ru_col < 0)
this_ru_col = 0;
-#endif
/* Never use more than half the window/screen width, leave the other
* half for the filename. */
- if (this_ru_col < (WITH_WIDTH(width) + 1) / 2)
- this_ru_col = (WITH_WIDTH(width) + 1) / 2;
- if (this_ru_col + o < WITH_WIDTH(width))
+ if (this_ru_col < (width + 1) / 2)
+ this_ru_col = (width + 1) / 2;
+ if (this_ru_col + o < width)
{
/* need at least 3 chars left for get_rel_pos() + NUL */
- while (this_ru_col + o < WITH_WIDTH(width) && RULER_BUF_LEN > i + 4)
+ while (this_ru_col + o < width && RULER_BUF_LEN > i + 4)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
for (i = 0; buffer[i] != NUL; i += (*mb_ptr2len)(buffer + i))
{
o += (*mb_ptr2cells)(buffer + i);
- if (this_ru_col + o > WITH_WIDTH(width))
+ if (this_ru_col + o > width)
{
buffer[i] = NUL;
break;
}
else
#endif
- if (this_ru_col + (int)STRLEN(buffer) > WITH_WIDTH(width))
- buffer[WITH_WIDTH(width) - this_ru_col] = NUL;
+ if (this_ru_col + (int)STRLEN(buffer) > width)
+ buffer[width - this_ru_col] = NUL;
- screen_puts(buffer, row, this_ru_col + WITH_OFF(off), attr);
+ screen_puts(buffer, row, this_ru_col + off, attr);
i = redraw_cmdline;
screen_fill(row, row + 1,
- this_ru_col + WITH_OFF(off) + (int)STRLEN(buffer),
- (int)(WITH_OFF(off) + WITH_WIDTH(width)),
+ this_ru_col + off + (int)STRLEN(buffer),
+ (int)(off + width),
fillchar, fillchar, attr);
/* don't redraw the cmdline because of showing the ruler */
redraw_cmdline = i;
char_u *already = NULL;
char_u *startp = NULL;
char_u *inc_opt = NULL;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
win_T *curwin_save = NULL;
#endif
{
found = TRUE;
if (depth == -1 && lnum == curwin->w_cursor.lnum
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
&& g_do_tagpreview == 0
#endif
)
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/* ":psearch" uses the preview window */
if (g_do_tagpreview != 0)
{
#endif
if (action == ACTION_SPLIT)
{
-#ifdef FEAT_WINDOWS
if (win_split(0, 0) == FAIL)
-#endif
break;
RESET_BINDING(curwin);
}
if (depth == -1)
{
/* match in current file */
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
if (!GETFILE_SUCCESS(getfile(
curwin->w_set_curswant = TRUE;
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0
&& curwin != curwin_save && win_valid(curwin_save))
{
if (wp->w_p_spell)
{
(void)did_set_spelllang(wp);
-# ifdef FEAT_WINDOWS
break;
-# endif
}
}
}
long wo_nuw;
# define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */
#endif
-#if defined(FEAT_WINDOWS)
int wo_wfh;
# define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */
int wo_wfw;
# define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */
-#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
int wo_pvw;
# define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */
#endif
# ifdef FEAT_BROWSE_CMD
int browse; /* TRUE to invoke file dialog */
# endif
-# ifdef FEAT_WINDOWS
int split; /* flags for win_split() */
int tab; /* > 0 when ":tab" was used */
-# endif
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
int confirm; /* TRUE to invoke yes/no dialog */
# endif
int ae_fnum; /* buffer number with expanded file name */
} aentry_T;
-#ifdef FEAT_WINDOWS
-# define ALIST(win) (win)->w_alist
-#else
-# define ALIST(win) (&global_alist)
-#endif
+#define ALIST(win) (win)->w_alist
#define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data)
#define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data)
#define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data)
struct frame_S
{
char fr_layout; /* FR_LEAF, FR_COL or FR_ROW */
-#ifdef FEAT_WINDOWS
int fr_width;
int fr_newwidth; /* new width used in win_equal_rec() */
-#endif
int fr_height;
int fr_newheight; /* new height used in win_equal_rec() */
frame_T *fr_parent; /* containing frame or NULL */
synblock_T *w_s; /* for :ownsyntax */
#endif
-#ifdef FEAT_WINDOWS
win_T *w_prev; /* link to previous window */
win_T *w_next; /* link to next window */
-#endif
#ifdef FEAT_AUTOCMD
int w_closing; /* window is being closed, don't let
autocommands close it too. */
* Layout of the window in the screen.
* May need to add "msg_scrolled" to "w_winrow" in rare situations.
*/
-#ifdef FEAT_WINDOWS
int w_winrow; /* first row of window in screen */
-#endif
int w_height; /* number of rows in window, excluding
status/command line(s) */
-#ifdef FEAT_WINDOWS
int w_status_height; /* number of status lines (0 or 1) */
int w_wincol; /* Leftmost column of window in screen.
use W_WINCOL() */
use W_WIDTH() */
int w_vsep_width; /* Number of separator columns (0 or 1).
use W_VSEP_WIDTH() */
-#endif
-
/*
* === start of cached values ====
*/
w_redr_type is REDRAW_TOP */
linenr_T w_redraw_top; /* when != 0: first line needing redraw */
linenr_T w_redraw_bot; /* when != 0: last line needing redraw */
-#ifdef FEAT_WINDOWS
int w_redr_status; /* if TRUE status line must be redrawn */
-#endif
#ifdef FEAT_CMDL_INFO
/* remember what is shown in the ruler for this window (if 'ruler' set) */
int w_alt_fnum; /* alternate file (for # and CTRL-^) */
-#ifdef FEAT_WINDOWS
alist_T *w_alist; /* pointer to arglist for this window */
-#endif
int w_arg_idx; /* current index in argument list (can be
out of range!) */
int w_arg_idx_invalid; /* editing another file than w_arg_idx */
#ifdef FEAT_EVAL
int use_debug_break_level;
#endif
-#ifdef FEAT_WINDOWS
int window_count; /* number of windows to use */
int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */
-#endif
#ifdef FEAT_CLIENTSERVER
int serverArg; /* TRUE when argument for a server */
CENT("StatusLineNC term=reverse cterm=reverse",
"StatusLineNC term=reverse cterm=reverse gui=reverse"),
"default link EndOfBuffer NonText",
-#ifdef FEAT_WINDOWS
CENT("VertSplit term=reverse cterm=reverse",
"VertSplit term=reverse cterm=reverse gui=reverse"),
-#endif
#ifdef FEAT_CLIPBOARD
CENT("VisualNOS term=underline,bold cterm=underline,bold",
"VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold"),
CENT("PmenuSbar ctermbg=Grey",
"PmenuSbar ctermbg=Grey guibg=Grey"),
#endif
-#ifdef FEAT_WINDOWS
CENT("TabLineSel term=bold cterm=bold",
"TabLineSel term=bold cterm=bold gui=bold"),
CENT("TabLineFill term=reverse cterm=reverse",
"TabLineFill term=reverse cterm=reverse gui=reverse"),
-#endif
#ifdef FEAT_GUI
"Cursor guibg=fg guifg=bg",
"lCursor guibg=fg guifg=bg", /* should be different, but what? */
CENT("DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan",
"DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan"),
#endif
-#ifdef FEAT_WINDOWS
CENT("TabLine term=underline cterm=underline ctermfg=black ctermbg=LightGrey",
"TabLine term=underline cterm=underline ctermfg=black ctermbg=LightGrey gui=underline guibg=LightGrey"),
-#endif
#ifdef FEAT_SYN_HL
CENT("CursorColumn term=reverse ctermbg=LightGrey",
"CursorColumn term=reverse ctermbg=LightGrey guibg=Grey90"),
CENT("DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan",
"DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan"),
#endif
-#ifdef FEAT_WINDOWS
CENT("TabLine term=underline cterm=underline ctermfg=white ctermbg=DarkGrey",
"TabLine term=underline cterm=underline ctermfg=white ctermbg=DarkGrey gui=underline guibg=DarkGrey"),
-#endif
#ifdef FEAT_SYN_HL
CENT("CursorColumn term=reverse ctermbg=DarkGrey",
"CursorColumn term=reverse ctermbg=DarkGrey guibg=Grey40"),
static char_u *tagmatchname = NULL; /* name of last used tag */
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/*
* Tag for preview window is remembered separately, to avoid messing up the
* normal tagstack.
{
use_tagstack = FALSE;
new_tag = TRUE;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
vim_free(ptag_entry.tagname);
}
else
{
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
use_tagstack = FALSE;
else
#endif
))
{
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
if (ptag_entry.tagname != NULL
else
{
if (
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
g_do_tagpreview != 0 ? ptag_entry.tagname == NULL :
#endif
tagstacklen == 0)
#endif
)
{
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
cur_match = ptag_entry.cur_match;
/* Save index for when selection is cancelled. */
prevtagstackidx = tagstackidx;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
cur_match = ptag_entry.cur_match;
}
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
if (type != DT_SELECT && type != DT_JUMP)
*/
if (use_tagstack)
name = tagstack[tagstackidx].tagname;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
else if (g_do_tagpreview != 0)
name = ptag_entry.tagname;
#endif
{
if (verbose)
EMSG2(_("E426: tag not found: %s"), name);
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
g_do_tagpreview = 0;
#endif
}
{
parse_match(matches[i], &tagp);
if (!new_tag && (
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
(g_do_tagpreview != 0
&& i == ptag_entry.cur_match) ||
#endif
tagstack[tagstackidx].cur_fnum = cur_fnum;
++tagstackidx;
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
else if (g_do_tagpreview != 0)
{
ptag_entry.cur_match = cur_match;
/* Only store the new index when using the tagstack and it's valid. */
if (use_tagstack && tagstackidx <= curwin->w_tagstacklen)
curwin->w_tagstackidx = tagstackidx;
-#ifdef FEAT_WINDOWS
postponed_split = 0; /* don't split next time */
# ifdef FEAT_QUICKFIX
g_do_tagpreview = 0; /* don't do tag preview next time */
# endif
-#endif
#ifdef FEAT_CSCOPE
return jumped_to_tag;
#endif
)
{
+ vim_memset(&tagp, 0, sizeof(tagp));
tagp.tagname = lbuf;
#ifdef FEAT_TAG_ANYWHITE
tagp.tagname_end = skiptowhite(lbuf);
if (*p == ':')
{
if (tagp.fname == NULL)
-#ifdef FEAT_TAG_ANYWHITE
+# ifdef FEAT_TAG_ANYWHITE
tagp.fname = skipwhite(tagp.tagname_end);
-#else
+# else
tagp.fname = tagp.tagname_end + 1;
-#endif
+# endif
if ( fnamencmp(lbuf, tagp.fname, p - lbuf) == 0
-#ifdef FEAT_TAG_ANYWHITE
+# ifdef FEAT_TAG_ANYWHITE
&& VIM_ISWHITE(tagp.fname[p - lbuf])
-#else
+# else
&& tagp.fname[p - lbuf] == TAB
-#endif
+# endif
)
{
/* found one */
do_tag(NULL, DT_FREE, 0, 0, 0);
tag_freematch();
-# if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+# if defined(FEAT_QUICKFIX)
if (ptag_entry.tagname)
{
vim_free(ptag_entry.tagname);
#ifdef FEAT_SEARCH_EXTRA
int save_no_hlsearch;
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
win_T *curwin_save = NULL;
#endif
char_u *full_fname = NULL;
need_mouse_correct = TRUE;
#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
postponed_split = 0; /* don't split again below */
{
/* A :ta from a help file will keep the b_help flag set. For ":ptag"
* we need to use the flag from the window where we came from. */
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
- keep_help_flag = curwin_save->w_buffer->b_help;
+ keep_help_flag = bt_help(curwin_save->w_buffer);
else
#endif
keep_help_flag = curbuf->b_help;
if (GETFILE_SUCCESS(getfile_result)) /* got to the right file */
{
curwin->w_set_curswant = TRUE;
-#ifdef FEAT_WINDOWS
postponed_split = 0;
-#endif
save_secure = secure;
secure = 1;
#endif
}
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0
&& curwin != curwin_save && win_valid(curwin_save))
{
else
{
--RedrawingDisabled;
-#ifdef FEAT_WINDOWS
if (postponed_split) /* close the window */
{
win_close(curwin, FALSE);
postponed_split = 0;
}
-#endif
}
erret:
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
g_do_tagpreview = 0; /* For next time */
#endif
if (tagp.fname_end != NULL)
# ifdef TERMINFO
{(int)KS_CDL, IF_EB("\033|%p1%dD", ESC_STR "|%p1%dD")},
{(int)KS_CS, IF_EB("\033|%p1%d;%p2%dR", ESC_STR "|%p1%d;%p2%dR")},
-# ifdef FEAT_WINDOWS
{(int)KS_CSV, IF_EB("\033|%p1%d;%p2%dV", ESC_STR "|%p1%d;%p2%dV")},
-# endif
# else
{(int)KS_CDL, IF_EB("\033|%dD", ESC_STR "|%dD")},
{(int)KS_CS, IF_EB("\033|%d;%dR", ESC_STR "|%d;%dR")},
-# ifdef FEAT_WINDOWS
{(int)KS_CSV, IF_EB("\033|%d;%dV", ESC_STR "|%d;%dV")},
-# endif
# endif
{(int)KS_CL, IF_EB("\033|C", ESC_STR "|C")},
/* attributes switched on with 'h', off with * 'H' */
# else
{(int)KS_CS, "[%dCS%d]"},
# endif
-# ifdef FEAT_WINDOWS
-# ifdef TERMINFO
+# ifdef TERMINFO
{(int)KS_CSV, "[%p1%dCSV%p2%d]"},
-# else
+# else
{(int)KS_CSV, "[%dCSV%d]"},
-# endif
# endif
# ifdef TERMINFO
{(int)KS_CAB, "[CAB%p1%d]"},
if (old_Columns != Columns)
{
old_Columns = Columns;
-#ifdef FEAT_WINDOWS
shell_new_columns(); /* update window sizes */
-#endif
}
}
{
OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1,
W_WINROW(wp) + off));
-#ifdef FEAT_WINDOWS
if (*T_CSV != NUL && wp->w_width != Columns)
OUT_STR(tgoto((char *)T_CSV, W_WINCOL(wp) + wp->w_width - 1,
W_WINCOL(wp)));
-#endif
screen_start(); /* don't know where cursor is now */
}
scroll_region_reset(void)
{
OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0));
-#ifdef FEAT_WINDOWS
if (*T_CSV != NUL)
OUT_STR(tgoto((char *)T_CSV, (int)Columns - 1, 0));
-#endif
screen_start(); /* don't know where cursor is now */
}
static int orig_topfill = 0;
# endif
#endif
-#if (defined(FEAT_WINDOWS) && defined(CHECK_DOUBLE_CLICK)) || defined(PROTO)
+#if defined(CHECK_DOUBLE_CLICK) || defined(PROTO)
/*
* Checking for double clicks ourselves.
* "orig_topline" is used to avoid detecting a double-click when the window
&& orig_topfill == curwin->w_topfill
#endif
)
-#ifdef FEAT_WINDOWS
/* Double click in tab pages line also works
* when window contents changes. */
- || (mouse_row == 0 && firstwin->w_winrow > 0)
-#endif
- )
+ || (mouse_row == 0 && firstwin->w_winrow > 0))
)
++orig_num_clicks;
else
KS_CSI, /* start insert mode (bar cursor) */
KS_CEI, /* end insert mode (block cursor) */
KS_CSR, /* start replace mode (underline cursor) */
-#ifdef FEAT_WINDOWS
KS_CSV, /* scroll region vertical */
-#endif
KS_OP, /* original color pair */
KS_U7, /* request cursor position */
KS_8F, /* set foreground color (RGB) */
endfunc
func! Test_normal50_commandline()
- if !has("timers") || !has("cmdline_hist") || !has("vertsplit")
+ if !has("timers") || !has("cmdline_hist")
return
endif
func! DoTimerWork(id)
int which_button) /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */
{
static int on_status_line = 0; /* #lines below bottom of window */
-#ifdef FEAT_WINDOWS
static int on_sep_line = 0; /* on separator right of window */
-#endif
static int prev_row = -1;
static int prev_col = -1;
static win_T *dragwin = NULL; /* window being dragged */
* line, stop Visual mode */
if (on_status_line)
return IN_STATUS_LINE;
-#ifdef FEAT_WINDOWS
if (on_sep_line)
return IN_SEP_LINE;
-#endif
if (flags & MOUSE_MAY_STOP_VIS)
{
end_visual_mode();
if (row < 0 || col < 0) /* check if it makes sense */
return IN_UNKNOWN;
-#ifdef FEAT_WINDOWS
/* find the window where the row is in */
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return IN_UNKNOWN;
-#else
- wp = firstwin;
-#endif
dragwin = NULL;
/*
* winpos and height may change in win_enter()!
}
else
on_status_line = 0;
-#ifdef FEAT_WINDOWS
if (col >= wp->w_width) /* In separator line */
{
on_sep_line = col - wp->w_width + 1;
else
on_status_line = 0;
}
-#endif
/* Before jumping to another buffer, or moving the cursor for a left
* click, stop Visual mode. */
if (VIsual_active
&& (wp->w_buffer != curwin->w_buffer
- || (!on_status_line
-#ifdef FEAT_WINDOWS
- && !on_sep_line
-#endif
+ || (!on_status_line && !on_sep_line
#ifdef FEAT_FOLDING
&& (
# ifdef FEAT_RIGHTLEFT
# endif
}
#endif
-#ifdef FEAT_WINDOWS
/* Only change window focus when not clicking on or dragging the
* status line. Do change focus when releasing the mouse button
* (MOUSE_FOCUS was set above if we dragged first). */
if (dragwin == NULL || (flags & MOUSE_RELEASED))
win_enter(wp, TRUE); /* can make wp invalid! */
-# ifdef CHECK_DOUBLE_CLICK
+#ifdef CHECK_DOUBLE_CLICK
/* set topline, to be able to check for double click ourselves */
if (curwin != old_curwin)
set_mouse_topline(curwin);
-# endif
#endif
if (on_status_line) /* In (or below) status line */
{
else
return IN_STATUS_LINE | CURSOR_MOVED;
}
-#ifdef FEAT_WINDOWS
if (on_sep_line) /* In (or below) status line */
{
/* Don't use start_arrow() if we're in the same window */
else
return IN_SEP_LINE | CURSOR_MOVED;
}
-#endif
curwin->w_cursor.lnum = curwin->w_topline;
#ifdef FEAT_GUI
}
else if (on_status_line && which_button == MOUSE_LEFT)
{
-#ifdef FEAT_WINDOWS
if (dragwin != NULL)
{
/* Drag the status line */
win_drag_status_line(dragwin, count);
did_drag |= count;
}
-#endif
return IN_STATUS_LINE; /* Cursor didn't move */
}
-#ifdef FEAT_WINDOWS
else if (on_sep_line && which_button == MOUSE_LEFT)
{
if (dragwin != NULL)
}
return IN_SEP_LINE; /* Cursor didn't move */
}
-#endif
else /* keep_window_focus must be TRUE */
{
/* before moving the cursor for a left click, stop Visual mode */
#endif
row -= W_WINROW(curwin);
-#ifdef FEAT_WINDOWS
col -= W_WINCOL(curwin);
-#endif
/*
* When clicking beyond the end of the window, scroll the screen.
return retval;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Find the window at screen position "*rowp" and "*colp". The positions are
* updated to become relative to the top-left of the window.
return wp;
return NULL;
}
-#endif
#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MAC) \
|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
if (row < 0 || col < 0) /* check if it makes sense */
return IN_UNKNOWN;
-#ifdef FEAT_WINDOWS
/* find the window where the row is in */
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return IN_UNKNOWN;
-#else
- wp = firstwin;
-#endif
/*
* winpos and height may change in win_enter()!
*/
if (row >= wp->w_height) /* In (or below) status line */
return IN_STATUS_LINE;
-#ifdef FEAT_WINDOWS
if (col >= wp->w_width) /* In vertical separator line */
return IN_SEP_LINE;
-#endif
if (wp != curwin)
return IN_UNKNOWN;
#else
"-user_commands",
#endif
-#ifdef FEAT_WINDOWS
"+vertsplit",
-#else
- "-vertsplit",
-#endif
#ifdef FEAT_VIRTUALEDIT
"+virtualedit",
#else
#else
"-wildmenu",
#endif
-#ifdef FEAT_WINDOWS
"+windows",
-#else
- "-windows",
-#endif
#ifdef FEAT_WRITEBACKUP
"+writebackup",
#else
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1118,
/**/
1117,
/**/
{
if (BUFEMPTY()
&& curbuf->b_fname == NULL
-#ifdef FEAT_WINDOWS
&& firstwin->w_next == NULL
-#endif
&& vim_strchr(p_shm, SHM_INTRO) == NULL)
intro_message(FALSE);
}
if (!p_cp)
blanklines += 4; /* add 4 for not showing "Vi compatible" message */
-#ifdef FEAT_WINDOWS
/* Don't overwrite a statusline. Depends on 'cmdheight'. */
if (p_ls > 1)
blanklines -= Rows - topframe->fr_height;
-#endif
if (blanklines < 0)
blanklines = 0;
#define FINDFILE_DIR 1 /* only directories */
#define FINDFILE_BOTH 2 /* files and directories */
-#ifdef FEAT_WINDOWS
-# define W_WINCOL(wp) (wp->w_wincol)
-# define W_WIDTH(wp) (wp->w_width)
-# define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
-# define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
-#else
-# define W_WINCOL(wp) 0
-# define W_WIDTH(wp) Columns
-# define W_ENDCOL(wp) Columns
-# define W_VSEP_WIDTH(wp) 0
-#endif
-#ifdef FEAT_WINDOWS
-# define W_STATUS_HEIGHT(wp) (wp->w_status_height)
-# define W_WINROW(wp) (wp->w_winrow)
-#else
-# define W_STATUS_HEIGHT(wp) 0
-# define W_WINROW(wp) 0
-#endif
+#define W_WINCOL(wp) (wp->w_wincol)
+#define W_WIDTH(wp) (wp->w_width)
+#define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
+#define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
+#define W_STATUS_HEIGHT(wp) (wp->w_status_height)
+#define W_WINROW(wp) (wp->w_winrow)
#ifdef NO_EXPANDPATH
# define gen_expand_wildcards mch_expand_wildcards
#include "vim.h"
static int path_is_url(char_u *p);
-#if defined(FEAT_WINDOWS) || defined(PROTO)
static void cmd_with_count(char *cmd, char_u *bufp, size_t bufsize, long Prenum);
static void win_init(win_T *newp, win_T *oldp, int flags);
static void win_init_some(win_T *newp, win_T *oldp);
static void frame_add_vsep(frame_T *frp);
static int frame_minwidth(frame_T *topfrp, win_T *next_curwin);
static void frame_fix_width(win_T *wp);
-#endif
static int win_alloc_firstwin(win_T *oldwin);
static void new_frame(win_T *wp);
-#if defined(FEAT_WINDOWS) || defined(PROTO)
static tabpage_T *alloc_tabpage(void);
static int leave_tabpage(buf_T *new_curbuf, int trigger_leave_autocmds);
static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, int trigger_enter_autocmds, int trigger_leave_autocmds);
static int frame_check_height(frame_T *topfrp, int height);
static int frame_check_width(frame_T *topfrp, int width);
-#endif /* FEAT_WINDOWS */
-
static win_T *win_alloc(win_T *after, int hidden);
#define URL_SLASH 1 /* path_is_url() has found "://" */
#define NOWIN (win_T *)-1 /* non-existing window */
-#ifdef FEAT_WINDOWS
-# define ROWS_AVAIL (Rows - p_ch - tabline_height())
-#else
-# define ROWS_AVAIL (Rows - p_ch)
-#endif
-
-#if defined(FEAT_WINDOWS) || defined(PROTO)
+#define ROWS_AVAIL (Rows - p_ch - tabline_height())
static char *m_onlyone = N_("Already only one window");
do_cmdline_cmd(cbuf);
break;
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
/* close preview window */
case Ctrl_Z:
case 'z':
win_copy_options(oldp, newp);
}
-#endif /* FEAT_WINDOWS */
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Check if "win" is a pointer to an existing window in the current tab page.
*/
{
int dummy;
-# ifdef FEAT_WINDOWS
while (first_tabpage->tp_next != NULL)
tabpage_close(TRUE);
-# endif
# ifdef FEAT_AUTOCMD
if (aucmd_win != NULL)
EMSG(_("E445: Other window contains changes"));
}
-#endif /* FEAT_WINDOWS */
-
/*
* Init the current window "curwin".
* Called when a new file is being edited.
if (win_alloc_firstwin(NULL) == FAIL)
return FAIL;
-#ifdef FEAT_WINDOWS
first_tabpage = alloc_tabpage();
if (first_tabpage == NULL)
return FAIL;
first_tabpage->tp_topframe = topframe;
curtab = first_tabpage;
-#endif
return OK;
}
/*
* Allocate the first window or the first window in a new tab page.
* When "oldwin" is NULL create an empty buffer for it.
- * When "oldwin" is not NULL copy info from it to the new window (only with
- * FEAT_WINDOWS).
+ * When "oldwin" is not NULL copy info from it to the new window.
* Return FAIL when something goes wrong (out of memory).
*/
static int
curwin->w_s = &(curbuf->b_s);
#endif
curbuf->b_nwindows = 1; /* there is one window */
-#ifdef FEAT_WINDOWS
curwin->w_alist = &global_alist;
-#endif
curwin_init(); /* init current window */
}
-#ifdef FEAT_WINDOWS
else
{
/* First window in new tab page, initialize it from "oldwin". */
/* We don't want cursor- and scroll-binding in the first window. */
RESET_BINDING(curwin);
}
-#endif
new_frame(curwin);
if (curwin->w_frame == NULL)
return FAIL;
topframe = curwin->w_frame;
-#ifdef FEAT_WINDOWS
topframe->fr_width = Columns;
-#endif
topframe->fr_height = Rows - p_ch;
topframe->fr_win = curwin;
{
firstwin->w_height = ROWS_AVAIL;
topframe->fr_height = ROWS_AVAIL;
-#ifdef FEAT_WINDOWS
firstwin->w_width = Columns;
topframe->fr_width = Columns;
-#endif
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
-
/*
* Allocate a new tabpage_T and init the values.
* Returns NULL when out of memory.
{
win_T *wp;
-# ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(wp)
if (--winnr == 0)
break;
return wp;
-# else
- return curwin;
-# endif
}
#endif
-#if (defined(FEAT_WINDOWS) && (defined(FEAT_PYTHON) || defined(FEAT_PYTHON3))) \
- || defined(PROTO)
+#if ((defined(FEAT_PYTHON) || defined(FEAT_PYTHON3))) || defined(PROTO)
/*
* Find the tabpage for window "win".
*/
DO_AUTOCHDIR
}
-#endif /* FEAT_WINDOWS */
-#if defined(FEAT_WINDOWS) || defined(FEAT_SIGNS) || defined(PROTO)
/*
* Jump to the first open window that contains buffer "buf", if one exists.
* Returns a pointer to the window found, otherwise NULL.
if (curwin->w_buffer == buf)
wp = curwin;
-# ifdef FEAT_WINDOWS
else
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer == buf)
break;
if (wp != NULL)
win_enter(wp, FALSE);
-# endif
return wp;
}
buf_jump_open_tab(buf_T *buf)
{
win_T *wp = buf_jump_open_win(buf);
-# ifdef FEAT_WINDOWS
tabpage_T *tp;
if (wp != NULL)
break;
}
}
-# endif
return wp;
}
-#endif
static int last_win_id = LOWEST_WIN_ID - 1;
/*
* link the window in the window list
*/
-#ifdef FEAT_WINDOWS
if (!hidden)
win_append(after, new_wp);
new_wp->w_wincol = 0;
new_wp->w_width = Columns;
-#endif
/* position the display and the cursor at the top of the file. */
new_wp->w_topline = 1;
return new_wp;
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
-
/*
* Remove window 'wp' from the window list and free the structure.
*/
frp->fr_next->fr_prev = frp->fr_prev;
}
-#endif /* FEAT_WINDOWS */
-
/*
* Allocate w_lines[] for window "wp".
* Return FAIL for failure, OK for success.
if (firstwin == NULL) /* not initialized yet */
return;
-#ifdef FEAT_WINDOWS
if (h < frame_minheight(topframe, NULL))
h = frame_minheight(topframe, NULL);
frame_new_height(topframe, h, FALSE, FALSE);
(void)win_comp_pos(); /* recompute w_winrow and w_wincol */
-#else
- if (h < 1)
- h = 1;
- win_new_height(firstwin, h);
-#endif
compute_cmdrow();
-#ifdef FEAT_WINDOWS
curtab->tp_ch_used = p_ch;
-#endif
#if 0
/* Disabled: don't want making the screen smaller make a window larger. */
#endif
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Called from win_new_shellsize() after Columns changed.
*/
win_equal(curwin, FALSE, 'h');
#endif
}
-#endif
#if defined(FEAT_CMDWIN) || defined(PROTO)
/*
}
#endif /* FEAT_CMDWIN */
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Update the position for all windows, using the width and height of the
* frames.
}
}
-#endif /* FEAT_WINDOWS */
-
/*
* Set current window height and take care of repositioning other windows to
* fit around it.
{
/* Always keep current window at least one line high, even when
* 'winminheight' is zero. */
-#ifdef FEAT_WINDOWS
if (height < p_wmh)
height = p_wmh;
-#endif
if (height == 0)
height = 1;
}
-#ifdef FEAT_WINDOWS
frame_setheight(win->w_frame, height + win->w_status_height);
/* recompute the window positions */
row = win_comp_pos();
-#else
- if (height > topframe->fr_height)
- height = topframe->fr_height;
- win->w_height = height;
- row = height;
-#endif
/*
* If there is extra space created between the last window and the command
redraw_all_later(NOT_VALID);
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
-
/*
* Set the height of a frame to "height" and take care that all frames and
* windows inside it are resized. Also resize frames on the left and right if
}
#endif /* FEAT_MOUSE */
-#endif /* FEAT_WINDOWS */
-
#define FRACTION_MULT 16384L
/*
win_comp_scroll(wp);
redraw_win_later(wp, SOME_VALID);
-#ifdef FEAT_WINDOWS
wp->w_redr_status = TRUE;
-#endif
invalidate_botline_win(wp);
}
-#ifdef FEAT_WINDOWS
/*
* Set the width of a window.
*/
redraw_win_later(wp, NOT_VALID);
wp->w_redr_status = TRUE;
}
-#endif
void
win_comp_scroll(win_T *wp)
void
command_height(void)
{
-#ifdef FEAT_WINDOWS
int h;
frame_T *frp;
int old_p_ch = curtab->tp_ch_used;
/* Recompute window positions. */
if (frp != lastwin->w_frame)
(void)win_comp_pos();
-#else
- cmdline_row = Rows - p_ch;
- win_setheight(cmdline_row);
-#endif
}
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Resize frame "frp" to be "n" lines higher (negative for less high).
* Also resize the frames it is contained in.
return 1;
}
-#endif /* FEAT_WINDOWS */
-
#if defined(FEAT_SEARCHPATH) || defined(PROTO)
/*
* Get the file name at the cursor.
min_rows(void)
{
int total;
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
int n;
-#endif
if (firstwin == NULL) /* not initialized yet */
return MIN_LINES;
-#ifdef FEAT_WINDOWS
total = 0;
FOR_ALL_TABPAGES(tp)
{
total = n;
}
total += tabline_height();
-#else
- total = 1; /* at least one window should have a line! */
-#endif
total += 1; /* count the room for the command line */
return total;
}
int
only_one_window(void)
{
-#ifdef FEAT_WINDOWS
int count = 0;
win_T *wp;
)
++count;
return (count <= 1);
-#else
- return TRUE;
-#endif
}
-#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Correct the cursor line number in other windows. Used after changing the
* current buffer, and before applying autocommands.
check_lnums(int do_curwin)
{
win_T *wp;
-
-#ifdef FEAT_WINDOWS
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, wp)
if ((do_curwin || wp != curwin) && wp->w_buffer == curbuf)
-#else
- wp = curwin;
- if (do_curwin)
-#endif
{
if (wp->w_cursor.lnum > curbuf->b_ml.ml_line_count)
wp->w_cursor.lnum = curbuf->b_ml.ml_line_count;
wp->w_topline = curbuf->b_ml.ml_line_count;
}
}
-#endif
-
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* A snapshot of the window sizes, to restore them after closing the help
return wp;
}
-#endif
-
#if defined(FEAT_EVAL) || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
/*
# ifdef FEAT_AUTOCMD
block_autocmds();
# endif
-# ifdef FEAT_WINDOWS
*save_curwin = curwin;
if (tp != NULL)
{
return FAIL;
curwin = win;
curbuf = curwin->w_buffer;
-# endif
return OK;
}
tabpage_T *save_curtab UNUSED,
int no_display UNUSED)
{
-# ifdef FEAT_WINDOWS
if (save_curtab != NULL && valid_tabpage(save_curtab))
{
if (no_display)
curwin = save_curwin;
curbuf = curwin->w_buffer;
}
-# endif
# ifdef FEAT_AUTOCMD
unblock_autocmds();
# endif
}
#endif
-#if (defined(FEAT_GUI) && defined(FEAT_WINDOWS)) || defined(PROTO)
+#if defined(FEAT_GUI) || defined(PROTO)
/*
* Return TRUE if there is any vertically split window.
*/
get_tab_number(tabpage_T *tp UNUSED)
{
int i = 1;
-# ifdef FEAT_WINDOWS
tabpage_T *t;
for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next)
if (t == NULL)
return 0;
else
-# endif
return i;
}
#endif
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Return TRUE if "topfrp" and its children are at the right height.
*/
return TRUE;
}
-#endif
-#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Return TRUE if "topfrp" and its children are at the right width.
*/
return TRUE;
}
-#endif
#if defined(FEAT_EVAL) || defined(PROTO)
int
}
else
{
-#ifdef FEAT_WINDOWS
/* buf is in a window */
if (win != curwin)
{
/* wsdebug("load_window: window enter %s\n",
win->w_buffer->b_sfname); */
}
-#endif
if (lnum > 0 && win->w_cursor.lnum != lnum)
{
warp_to_pc(lnum);