Skip to content

Commit e2c3810

Browse files
committed
patch 7.4.1222
Problem: ":normal" command and others missing in tiny build. Solution: Graduate FEAT_EX_EXTRA.
1 parent 3c124e3 commit e2c3810

12 files changed

Lines changed: 12 additions & 94 deletions

File tree

src/charset.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -822,14 +822,11 @@ vim_strnsize(char_u *s, int len)
822822
else \
823823
return ptr2cells(p);
824824

825-
#if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || defined(FEAT_GUI) \
826-
|| defined(FEAT_VIRTUALEDIT) || defined(PROTO)
827825
int
828826
chartabsize(char_u *p, colnr_T col)
829827
{
830828
RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
831829
}
832-
#endif
833830

834831
#ifdef FEAT_LINEBREAK
835832
static int
@@ -1568,7 +1565,6 @@ skiphex(char_u *q)
15681565
}
15691566
#endif
15701567

1571-
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
15721568
/*
15731569
* skip to bin digit (or NUL after the string)
15741570
*/
@@ -1607,7 +1603,6 @@ skiptohex(char_u *q)
16071603
++p;
16081604
return p;
16091605
}
1610-
#endif
16111606

16121607
/*
16131608
* Variant of isdigit() that can handle characters > 0x100.

src/eval.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12855,9 +12855,7 @@ f_has(typval_T *argvars, typval_T *rettv)
1285512855
"emacs_tags",
1285612856
#endif
1285712857
"eval", /* always present, of course! */
12858-
#ifdef FEAT_EX_EXTRA
12859-
"ex_extra",
12860-
#endif
12858+
"ex_extra", /* graduated feature */
1286112859
#ifdef FEAT_SEARCH_EXTRA
1286212860
"extra_search",
1286312861
#endif
@@ -13684,16 +13682,12 @@ get_user_input(
1368413682

1368513683
if (defstr != NULL)
1368613684
{
13687-
# ifdef FEAT_EX_EXTRA
1368813685
int save_ex_normal_busy = ex_normal_busy;
1368913686
ex_normal_busy = 0;
13690-
# endif
1369113687
rettv->vval.v_string =
1369213688
getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
1369313689
xp_type, xp_arg);
13694-
# ifdef FEAT_EX_EXTRA
1369513690
ex_normal_busy = save_ex_normal_busy;
13696-
# endif
1369713691
}
1369813692
if (inputdialog && rettv->vval.v_string == NULL
1369913693
&& argvars[1].v_type != VAR_UNKNOWN

src/ex_cmds.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
# include <float.h>
1919
#endif
2020

21-
#ifdef FEAT_EX_EXTRA
2221
static int linelen(int *has_tab);
23-
#endif
2422
static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
2523
#ifdef FEAT_VIMINFO
2624
static char_u *viminfo_filename(char_u *);
@@ -138,7 +136,6 @@ do_ascii(exarg_T *eap UNUSED)
138136
msg(IObuff);
139137
}
140138

141-
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
142139
/*
143140
* ":left", ":center" and ":right": align text.
144141
*/
@@ -787,7 +784,6 @@ ex_retab(exarg_T *eap)
787784

788785
u_clearline();
789786
}
790-
#endif
791787

792788
/*
793789
* :move command - move lines line1-line2 to line dest
@@ -6577,7 +6573,6 @@ ex_viusage(exarg_T *eap UNUSED)
65776573
do_cmdline_cmd((char_u *)"help normal-index");
65786574
}
65796575

6580-
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
65816576
static void helptags_one(char_u *dir, char_u *ext, char_u *lang, int add_help_tags);
65826577

65836578
/*
@@ -6962,7 +6957,6 @@ helptags_one(
69626957
ga_clear(&ga);
69636958
fclose(fd_tags); /* there is no check for an error... */
69646959
}
6965-
#endif
69666960

69676961
#if defined(FEAT_SIGNS) || defined(PROTO)
69686962

src/ex_cmds2.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ do_debug(char_u *cmd)
9090
tasave_T typeaheadbuf;
9191
int typeahead_saved = FALSE;
9292
int save_ignore_script = 0;
93-
# ifdef FEAT_EX_EXTRA
9493
int save_ex_normal_busy;
95-
# endif
9694
int n;
9795
char_u *cmdline = NULL;
9896
char_u *p;
@@ -161,10 +159,8 @@ do_debug(char_u *cmd)
161159
* with the commands being executed. Reset "ex_normal_busy" to avoid
162160
* the side effects of using ":normal". Save the stuff buffer and make
163161
* it empty. Set ignore_script to avoid reading from script input. */
164-
# ifdef FEAT_EX_EXTRA
165162
save_ex_normal_busy = ex_normal_busy;
166163
ex_normal_busy = 0;
167-
# endif
168164
if (!debug_greedy)
169165
{
170166
save_typeahead(&typeaheadbuf);
@@ -180,9 +176,7 @@ do_debug(char_u *cmd)
180176
restore_typeahead(&typeaheadbuf);
181177
ignore_script = save_ignore_script;
182178
}
183-
# ifdef FEAT_EX_EXTRA
184179
ex_normal_busy = save_ex_normal_busy;
185-
# endif
186180

187181
cmdline_row = msg_row;
188182
msg_starthere();

src/ex_docmd.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -344,18 +344,8 @@ static void ex_mark(exarg_T *eap);
344344
static char_u *uc_fun_cmd(void);
345345
static char_u *find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *compl);
346346
#endif
347-
#ifdef FEAT_EX_EXTRA
348347
static void ex_startinsert(exarg_T *eap);
349348
static void ex_stopinsert(exarg_T *eap);
350-
#else
351-
# define ex_normal ex_ni
352-
# define ex_align ex_ni
353-
# define ex_retab ex_ni
354-
# define ex_startinsert ex_ni
355-
# define ex_stopinsert ex_ni
356-
# define ex_helptags ex_ni
357-
# define ex_sort ex_ni
358-
#endif
359349
#ifdef FEAT_FIND_ID
360350
static void ex_checkpath(exarg_T *eap);
361351
static void ex_findpat(exarg_T *eap);
@@ -659,14 +649,12 @@ do_exmode(
659649
MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode."));
660650
while (exmode_active)
661651
{
662-
#ifdef FEAT_EX_EXTRA
663652
/* Check for a ":normal" command and no more characters left. */
664653
if (ex_normal_busy > 0 && typebuf.tb_len == 0)
665654
{
666655
exmode_active = FALSE;
667656
break;
668657
}
669-
#endif
670658
msg_scroll = TRUE;
671659
need_wait_return = FALSE;
672660
ex_pressedreturn = FALSE;
@@ -9860,7 +9848,6 @@ update_topline_cursor(void)
98609848
update_curswant();
98619849
}
98629850

9863-
#if defined(FEAT_EX_EXTRA) || defined(PROTO)
98649851
/*
98659852
* ":normal[!] {commands}": Execute normal mode commands.
98669853
*/
@@ -10062,9 +10049,7 @@ ex_stopinsert(exarg_T *eap UNUSED)
1006210049
restart_edit = 0;
1006310050
stop_insert_mode = TRUE;
1006410051
}
10065-
#endif
1006610052

10067-
#if defined(FEAT_EX_EXTRA) || defined(FEAT_MENU) || defined(PROTO)
1006810053
/*
1006910054
* Execute normal mode command "cmd".
1007010055
* "remap" can be REMAP_NONE or REMAP_YES.
@@ -10076,10 +10061,7 @@ exec_normal_cmd(char_u *cmd, int remap, int silent)
1007610061
ins_typebuf(cmd, remap, 0, TRUE, silent);
1007710062
exec_normal(FALSE);
1007810063
}
10079-
#endif
1008010064

10081-
#if defined(FEAT_EX_EXTRA) || defined(FEAT_MENU) || defined(FEAT_EVAL) \
10082-
|| defined(PROTO)
1008310065
/*
1008410066
* Execute normal_cmd() until there is no typeahead left.
1008510067
*/
@@ -10097,7 +10079,6 @@ exec_normal(int was_typed)
1009710079
normal_cmd(&oa, TRUE); /* execute a Normal mode cmd */
1009810080
}
1009910081
}
10100-
#endif
1010110082

1010210083
#ifdef FEAT_FIND_ID
1010310084
static void

src/ex_getln.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,7 @@ getcmdline(
11291129
/* In exmode it doesn't make sense to return. Except when
11301130
* ":normal" runs out of characters. */
11311131
if (exmode_active
1132-
#ifdef FEAT_EX_EXTRA
1133-
&& (ex_normal_busy == 0 || typebuf.tb_len > 0)
1134-
#endif
1135-
)
1132+
&& (ex_normal_busy == 0 || typebuf.tb_len > 0))
11361133
goto cmdline_not_changed;
11371134

11381135
gotesc = TRUE; /* will free ccline.cmdbuff after

src/feature.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,6 @@
253253
# define FEAT_LINEBREAK
254254
#endif
255255

256-
/*
257-
* +ex_extra ":retab", ":right", ":left", ":center", ":normal".
258-
*/
259-
#if defined(FEAT_NORMAL) || defined(FEAT_CHANNEL)
260-
# define FEAT_EX_EXTRA
261-
#endif
262-
263256
/*
264257
* +extra_search 'hlsearch' and 'incsearch' options.
265258
*/

src/getchar.c

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,6 @@ static int old_mouse_row; /* mouse_row related to old_char */
13561356
static int old_mouse_col; /* mouse_col related to old_char */
13571357
#endif
13581358

1359-
#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
1360-
13611359
/*
13621360
* Save all three kinds of typeahead, so that the user must type at a prompt.
13631361
*/
@@ -1406,7 +1404,6 @@ restore_typeahead(tasave_T *tp)
14061404
set_input_buf(tp->save_inputbuf);
14071405
# endif
14081406
}
1409-
#endif
14101407

14111408
/*
14121409
* Open a new script file for the ":source!" command.
@@ -1981,11 +1978,7 @@ vgetorpeek(int advance)
19811978
* Using ":normal" can also do this, but it saves the typeahead buffer,
19821979
* thus it should be OK. But don't get a key from the user then.
19831980
*/
1984-
if (vgetc_busy > 0
1985-
#ifdef FEAT_EX_EXTRA
1986-
&& ex_normal_busy == 0
1987-
#endif
1988-
)
1981+
if (vgetc_busy > 0 && ex_normal_busy == 0)
19891982
return NUL;
19901983

19911984
local_State = get_real_state();
@@ -2605,9 +2598,7 @@ vgetorpeek(int advance)
26052598
&& typebuf.tb_len == 1
26062599
&& typebuf.tb_buf[typebuf.tb_off] == ESC
26072600
&& !no_mapping
2608-
#ifdef FEAT_EX_EXTRA
26092601
&& ex_normal_busy == 0
2610-
#endif
26112602
&& typebuf.tb_maplen == 0
26122603
&& (State & INSERT)
26132604
&& (p_timeout
@@ -2729,12 +2720,11 @@ vgetorpeek(int advance)
27292720
continue;
27302721
}
27312722

2732-
#ifdef FEAT_EX_EXTRA
27332723
if (ex_normal_busy > 0)
27342724
{
2735-
# ifdef FEAT_CMDWIN
2725+
#ifdef FEAT_CMDWIN
27362726
static int tc = 0;
2737-
# endif
2727+
#endif
27382728

27392729
/* No typeahead left and inside ":normal". Must return
27402730
* something to avoid getting stuck. When an incomplete
@@ -2753,19 +2743,18 @@ vgetorpeek(int advance)
27532743
if (p_im && (State & INSERT))
27542744
c = Ctrl_L;
27552745
else if ((State & CMDLINE)
2756-
# ifdef FEAT_CMDWIN
2746+
#ifdef FEAT_CMDWIN
27572747
|| (cmdwin_type > 0 && tc == ESC)
2758-
# endif
2748+
#endif
27592749
)
27602750
c = Ctrl_C;
27612751
else
27622752
c = ESC;
2763-
# ifdef FEAT_CMDWIN
2753+
#ifdef FEAT_CMDWIN
27642754
tc = c;
2765-
# endif
2755+
#endif
27662756
break;
27672757
}
2768-
#endif
27692758

27702759
/*
27712760
* get a character: 3. from the user - update display
@@ -4638,18 +4627,14 @@ eval_map_expr(
46384627
/* Forbid changing text or using ":normal" to avoid most of the bad side
46394628
* effects. Also restore the cursor position. */
46404629
++textlock;
4641-
#ifdef FEAT_EX_EXTRA
46424630
++ex_normal_lock;
4643-
#endif
46444631
set_vim_var_char(c); /* set v:char to the typed character */
46454632
save_cursor = curwin->w_cursor;
46464633
save_msg_col = msg_col;
46474634
save_msg_row = msg_row;
46484635
p = eval_to_string(expr, NULL, FALSE);
46494636
--textlock;
4650-
#ifdef FEAT_EX_EXTRA
46514637
--ex_normal_lock;
4652-
#endif
46534638
curwin->w_cursor = save_cursor;
46544639
msg_col = save_msg_col;
46554640
msg_row = save_msg_row;

src/globals.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,8 @@ EXTERN typebuf_T typebuf /* typeahead buffer */
995995
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
996996
#endif
997997
;
998-
#ifdef FEAT_EX_EXTRA
999998
EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */
1000999
EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */
1001-
#endif
10021000
#ifdef FEAT_EVAL
10031001
EXTERN int ignore_script INIT(= FALSE); /* ignore script input */
10041002
#endif
@@ -1573,9 +1571,7 @@ EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxm
15731571
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
15741572
EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %ld does not exist"));
15751573

1576-
#ifdef FEAT_EX_EXTRA
15771574
EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter"));
1578-
#endif
15791575
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
15801576
#if defined(FEAT_SYN_HL) || \
15811577
(defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC))

src/normal.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8924,11 +8924,7 @@ nv_esc(cmdarg_T *cap)
89248924

89258925
/* A CTRL-C is often used at the start of a menu. When 'insertmode' is
89268926
* set return to Insert mode afterwards. */
8927-
if (restart_edit == 0 && goto_im()
8928-
#ifdef FEAT_EX_EXTRA
8929-
&& ex_normal_busy == 0
8930-
#endif
8931-
)
8927+
if (restart_edit == 0 && goto_im() && ex_normal_busy == 0)
89328928
restart_edit = 'a';
89338929
}
89348930

0 commit comments

Comments
 (0)