patch 7.4.1222

Problem:    ":normal" command and others missing in tiny build.
Solution:   Graduate FEAT_EX_EXTRA.
This commit is contained in:
Bram Moolenaar
2016-01-31 14:55:40 +01:00
parent 3c124e3ac8
commit e2c3810c2a
12 changed files with 12 additions and 94 deletions

View File

@@ -822,14 +822,11 @@ vim_strnsize(char_u *s, int len)
else \ else \
return ptr2cells(p); return ptr2cells(p);
#if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || defined(FEAT_GUI) \
|| defined(FEAT_VIRTUALEDIT) || defined(PROTO)
int int
chartabsize(char_u *p, colnr_T col) chartabsize(char_u *p, colnr_T col)
{ {
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col) RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
} }
#endif
#ifdef FEAT_LINEBREAK #ifdef FEAT_LINEBREAK
static int static int
@@ -1568,7 +1565,6 @@ skiphex(char_u *q)
} }
#endif #endif
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
/* /*
* skip to bin digit (or NUL after the string) * skip to bin digit (or NUL after the string)
*/ */
@@ -1607,7 +1603,6 @@ skiptohex(char_u *q)
++p; ++p;
return p; return p;
} }
#endif
/* /*
* Variant of isdigit() that can handle characters > 0x100. * Variant of isdigit() that can handle characters > 0x100.

View File

@@ -12855,9 +12855,7 @@ f_has(typval_T *argvars, typval_T *rettv)
"emacs_tags", "emacs_tags",
#endif #endif
"eval", /* always present, of course! */ "eval", /* always present, of course! */
#ifdef FEAT_EX_EXTRA "ex_extra", /* graduated feature */
"ex_extra",
#endif
#ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
"extra_search", "extra_search",
#endif #endif
@@ -13684,16 +13682,12 @@ get_user_input(
if (defstr != NULL) if (defstr != NULL)
{ {
# ifdef FEAT_EX_EXTRA
int save_ex_normal_busy = ex_normal_busy; int save_ex_normal_busy = ex_normal_busy;
ex_normal_busy = 0; ex_normal_busy = 0;
# endif
rettv->vval.v_string = rettv->vval.v_string =
getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
xp_type, xp_arg); xp_type, xp_arg);
# ifdef FEAT_EX_EXTRA
ex_normal_busy = save_ex_normal_busy; ex_normal_busy = save_ex_normal_busy;
# endif
} }
if (inputdialog && rettv->vval.v_string == NULL if (inputdialog && rettv->vval.v_string == NULL
&& argvars[1].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_UNKNOWN

View File

@@ -18,9 +18,7 @@
# include <float.h> # include <float.h>
#endif #endif
#ifdef FEAT_EX_EXTRA
static int linelen(int *has_tab); static int linelen(int *has_tab);
#endif
static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out); static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
#ifdef FEAT_VIMINFO #ifdef FEAT_VIMINFO
static char_u *viminfo_filename(char_u *); static char_u *viminfo_filename(char_u *);
@@ -138,7 +136,6 @@ do_ascii(exarg_T *eap UNUSED)
msg(IObuff); msg(IObuff);
} }
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
/* /*
* ":left", ":center" and ":right": align text. * ":left", ":center" and ":right": align text.
*/ */
@@ -787,7 +784,6 @@ ex_retab(exarg_T *eap)
u_clearline(); u_clearline();
} }
#endif
/* /*
* :move command - move lines line1-line2 to line dest * :move command - move lines line1-line2 to line dest
@@ -6577,7 +6573,6 @@ ex_viusage(exarg_T *eap UNUSED)
do_cmdline_cmd((char_u *)"help normal-index"); do_cmdline_cmd((char_u *)"help normal-index");
} }
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
static void helptags_one(char_u *dir, char_u *ext, char_u *lang, int add_help_tags); static void helptags_one(char_u *dir, char_u *ext, char_u *lang, int add_help_tags);
/* /*
@@ -6962,7 +6957,6 @@ helptags_one(
ga_clear(&ga); ga_clear(&ga);
fclose(fd_tags); /* there is no check for an error... */ fclose(fd_tags); /* there is no check for an error... */
} }
#endif
#if defined(FEAT_SIGNS) || defined(PROTO) #if defined(FEAT_SIGNS) || defined(PROTO)

View File

@@ -90,9 +90,7 @@ do_debug(char_u *cmd)
tasave_T typeaheadbuf; tasave_T typeaheadbuf;
int typeahead_saved = FALSE; int typeahead_saved = FALSE;
int save_ignore_script = 0; int save_ignore_script = 0;
# ifdef FEAT_EX_EXTRA
int save_ex_normal_busy; int save_ex_normal_busy;
# endif
int n; int n;
char_u *cmdline = NULL; char_u *cmdline = NULL;
char_u *p; char_u *p;
@@ -161,10 +159,8 @@ do_debug(char_u *cmd)
* with the commands being executed. Reset "ex_normal_busy" to avoid * with the commands being executed. Reset "ex_normal_busy" to avoid
* the side effects of using ":normal". Save the stuff buffer and make * the side effects of using ":normal". Save the stuff buffer and make
* it empty. Set ignore_script to avoid reading from script input. */ * it empty. Set ignore_script to avoid reading from script input. */
# ifdef FEAT_EX_EXTRA
save_ex_normal_busy = ex_normal_busy; save_ex_normal_busy = ex_normal_busy;
ex_normal_busy = 0; ex_normal_busy = 0;
# endif
if (!debug_greedy) if (!debug_greedy)
{ {
save_typeahead(&typeaheadbuf); save_typeahead(&typeaheadbuf);
@@ -180,9 +176,7 @@ do_debug(char_u *cmd)
restore_typeahead(&typeaheadbuf); restore_typeahead(&typeaheadbuf);
ignore_script = save_ignore_script; ignore_script = save_ignore_script;
} }
# ifdef FEAT_EX_EXTRA
ex_normal_busy = save_ex_normal_busy; ex_normal_busy = save_ex_normal_busy;
# endif
cmdline_row = msg_row; cmdline_row = msg_row;
msg_starthere(); msg_starthere();

View File

@@ -344,18 +344,8 @@ static void ex_mark(exarg_T *eap);
static char_u *uc_fun_cmd(void); static char_u *uc_fun_cmd(void);
static char_u *find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *compl); static char_u *find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *compl);
#endif #endif
#ifdef FEAT_EX_EXTRA
static void ex_startinsert(exarg_T *eap); static void ex_startinsert(exarg_T *eap);
static void ex_stopinsert(exarg_T *eap); static void ex_stopinsert(exarg_T *eap);
#else
# define ex_normal ex_ni
# define ex_align ex_ni
# define ex_retab ex_ni
# define ex_startinsert ex_ni
# define ex_stopinsert ex_ni
# define ex_helptags ex_ni
# define ex_sort ex_ni
#endif
#ifdef FEAT_FIND_ID #ifdef FEAT_FIND_ID
static void ex_checkpath(exarg_T *eap); static void ex_checkpath(exarg_T *eap);
static void ex_findpat(exarg_T *eap); static void ex_findpat(exarg_T *eap);
@@ -659,14 +649,12 @@ do_exmode(
MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode."));
while (exmode_active) while (exmode_active)
{ {
#ifdef FEAT_EX_EXTRA
/* Check for a ":normal" command and no more characters left. */ /* Check for a ":normal" command and no more characters left. */
if (ex_normal_busy > 0 && typebuf.tb_len == 0) if (ex_normal_busy > 0 && typebuf.tb_len == 0)
{ {
exmode_active = FALSE; exmode_active = FALSE;
break; break;
} }
#endif
msg_scroll = TRUE; msg_scroll = TRUE;
need_wait_return = FALSE; need_wait_return = FALSE;
ex_pressedreturn = FALSE; ex_pressedreturn = FALSE;
@@ -9860,7 +9848,6 @@ update_topline_cursor(void)
update_curswant(); update_curswant();
} }
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
/* /*
* ":normal[!] {commands}": Execute normal mode commands. * ":normal[!] {commands}": Execute normal mode commands.
*/ */
@@ -10062,9 +10049,7 @@ ex_stopinsert(exarg_T *eap UNUSED)
restart_edit = 0; restart_edit = 0;
stop_insert_mode = TRUE; stop_insert_mode = TRUE;
} }
#endif
#if defined(FEAT_EX_EXTRA) || defined(FEAT_MENU) || defined(PROTO)
/* /*
* Execute normal mode command "cmd". * Execute normal mode command "cmd".
* "remap" can be REMAP_NONE or REMAP_YES. * "remap" can be REMAP_NONE or REMAP_YES.
@@ -10076,10 +10061,7 @@ exec_normal_cmd(char_u *cmd, int remap, int silent)
ins_typebuf(cmd, remap, 0, TRUE, silent); ins_typebuf(cmd, remap, 0, TRUE, silent);
exec_normal(FALSE); exec_normal(FALSE);
} }
#endif
#if defined(FEAT_EX_EXTRA) || defined(FEAT_MENU) || defined(FEAT_EVAL) \
|| defined(PROTO)
/* /*
* Execute normal_cmd() until there is no typeahead left. * Execute normal_cmd() until there is no typeahead left.
*/ */
@@ -10097,7 +10079,6 @@ exec_normal(int was_typed)
normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */ normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */
} }
} }
#endif
#ifdef FEAT_FIND_ID #ifdef FEAT_FIND_ID
static void static void

View File

@@ -1129,10 +1129,7 @@ getcmdline(
/* In exmode it doesn't make sense to return. Except when /* In exmode it doesn't make sense to return. Except when
* ":normal" runs out of characters. */ * ":normal" runs out of characters. */
if (exmode_active if (exmode_active
#ifdef FEAT_EX_EXTRA && (ex_normal_busy == 0 || typebuf.tb_len > 0))
&& (ex_normal_busy == 0 || typebuf.tb_len > 0)
#endif
)
goto cmdline_not_changed; goto cmdline_not_changed;
gotesc = TRUE; /* will free ccline.cmdbuff after gotesc = TRUE; /* will free ccline.cmdbuff after

View File

@@ -253,13 +253,6 @@
# define FEAT_LINEBREAK # define FEAT_LINEBREAK
#endif #endif
/*
* +ex_extra ":retab", ":right", ":left", ":center", ":normal".
*/
#if defined(FEAT_NORMAL) || defined(FEAT_CHANNEL)
# define FEAT_EX_EXTRA
#endif
/* /*
* +extra_search 'hlsearch' and 'incsearch' options. * +extra_search 'hlsearch' and 'incsearch' options.
*/ */

View File

@@ -1356,8 +1356,6 @@ static int old_mouse_row; /* mouse_row related to old_char */
static int old_mouse_col; /* mouse_col related to old_char */ static int old_mouse_col; /* mouse_col related to old_char */
#endif #endif
#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
/* /*
* Save all three kinds of typeahead, so that the user must type at a prompt. * Save all three kinds of typeahead, so that the user must type at a prompt.
*/ */
@@ -1406,7 +1404,6 @@ restore_typeahead(tasave_T *tp)
set_input_buf(tp->save_inputbuf); set_input_buf(tp->save_inputbuf);
# endif # endif
} }
#endif
/* /*
* Open a new script file for the ":source!" command. * Open a new script file for the ":source!" command.
@@ -1981,11 +1978,7 @@ vgetorpeek(int advance)
* Using ":normal" can also do this, but it saves the typeahead buffer, * Using ":normal" can also do this, but it saves the typeahead buffer,
* thus it should be OK. But don't get a key from the user then. * thus it should be OK. But don't get a key from the user then.
*/ */
if (vgetc_busy > 0 if (vgetc_busy > 0 && ex_normal_busy == 0)
#ifdef FEAT_EX_EXTRA
&& ex_normal_busy == 0
#endif
)
return NUL; return NUL;
local_State = get_real_state(); local_State = get_real_state();
@@ -2605,9 +2598,7 @@ vgetorpeek(int advance)
&& typebuf.tb_len == 1 && typebuf.tb_len == 1
&& typebuf.tb_buf[typebuf.tb_off] == ESC && typebuf.tb_buf[typebuf.tb_off] == ESC
&& !no_mapping && !no_mapping
#ifdef FEAT_EX_EXTRA
&& ex_normal_busy == 0 && ex_normal_busy == 0
#endif
&& typebuf.tb_maplen == 0 && typebuf.tb_maplen == 0
&& (State & INSERT) && (State & INSERT)
&& (p_timeout && (p_timeout
@@ -2729,7 +2720,6 @@ vgetorpeek(int advance)
continue; continue;
} }
#ifdef FEAT_EX_EXTRA
if (ex_normal_busy > 0) if (ex_normal_busy > 0)
{ {
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
@@ -2765,7 +2755,6 @@ vgetorpeek(int advance)
#endif #endif
break; break;
} }
#endif
/* /*
* get a character: 3. from the user - update display * get a character: 3. from the user - update display
@@ -4638,18 +4627,14 @@ eval_map_expr(
/* Forbid changing text or using ":normal" to avoid most of the bad side /* Forbid changing text or using ":normal" to avoid most of the bad side
* effects. Also restore the cursor position. */ * effects. Also restore the cursor position. */
++textlock; ++textlock;
#ifdef FEAT_EX_EXTRA
++ex_normal_lock; ++ex_normal_lock;
#endif
set_vim_var_char(c); /* set v:char to the typed character */ set_vim_var_char(c); /* set v:char to the typed character */
save_cursor = curwin->w_cursor; save_cursor = curwin->w_cursor;
save_msg_col = msg_col; save_msg_col = msg_col;
save_msg_row = msg_row; save_msg_row = msg_row;
p = eval_to_string(expr, NULL, FALSE); p = eval_to_string(expr, NULL, FALSE);
--textlock; --textlock;
#ifdef FEAT_EX_EXTRA
--ex_normal_lock; --ex_normal_lock;
#endif
curwin->w_cursor = save_cursor; curwin->w_cursor = save_cursor;
msg_col = save_msg_col; msg_col = save_msg_col;
msg_row = save_msg_row; msg_row = save_msg_row;

View File

@@ -995,10 +995,8 @@ EXTERN typebuf_T typebuf /* typeahead buffer */
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
#endif #endif
; ;
#ifdef FEAT_EX_EXTRA
EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */ EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */
EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */ EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */
#endif
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
EXTERN int ignore_script INIT(= FALSE); /* ignore script input */ EXTERN int ignore_script INIT(= FALSE); /* ignore script input */
#endif #endif
@@ -1573,9 +1571,7 @@ EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxm
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer")); EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist")); EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist"));
#ifdef FEAT_EX_EXTRA
EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter")); EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter"));
#endif
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer")); EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
#if defined(FEAT_SYN_HL) || \ #if defined(FEAT_SYN_HL) || \
(defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC)) (defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))

View File

@@ -8924,11 +8924,7 @@ nv_esc(cmdarg_T *cap)
/* A CTRL-C is often used at the start of a menu. When 'insertmode' is /* A CTRL-C is often used at the start of a menu. When 'insertmode' is
* set return to Insert mode afterwards. */ * set return to Insert mode afterwards. */
if (restart_edit == 0 && goto_im() if (restart_edit == 0 && goto_im() && ex_normal_busy == 0)
#ifdef FEAT_EX_EXTRA
&& ex_normal_busy == 0
#endif
)
restart_edit = 'a'; restart_edit = 'a';
} }

View File

@@ -1580,7 +1580,6 @@ vim_used_in_input_buf(void)
} }
#endif #endif
#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
/* /*
* Return the current contents of the input buffer and make it empty. * Return the current contents of the input buffer and make it empty.
* The returned pointer must be passed to set_input_buf() later. * The returned pointer must be passed to set_input_buf() later.
@@ -1624,7 +1623,6 @@ set_input_buf(char_u *p)
vim_free(gap); vim_free(gap);
} }
} }
#endif
#if defined(FEAT_GUI) \ #if defined(FEAT_GUI) \
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE) \ || defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE) \
@@ -1701,15 +1699,12 @@ push_raw_key(char_u *s, int len)
} }
#endif #endif
#if defined(FEAT_GUI) || defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) \
|| defined(PROTO)
/* Remove everything from the input buffer. Called when ^C is found */ /* Remove everything from the input buffer. Called when ^C is found */
void void
trash_input_buf(void) trash_input_buf(void)
{ {
inbufcount = 0; inbufcount = 0;
} }
#endif
/* /*
* Read as much data from the input buffer as possible up to maxlen, and store * Read as much data from the input buffer as possible up to maxlen, and store

View File

@@ -221,11 +221,7 @@ static char *(features[]) =
#else #else
"-eval", "-eval",
#endif #endif
#ifdef FEAT_EX_EXTRA
"+ex_extra", "+ex_extra",
#else
"-ex_extra",
#endif
#ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
"+extra_search", "+extra_search",
#else #else
@@ -746,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1222,
/**/ /**/
1221, 1221,
/**/ /**/