Skip to content

Commit 2e28c52

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 2defaf5 + 1ef73e3 commit 2e28c52

24 files changed

+1735
-43
lines changed

runtime/doc/eval.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,6 @@ tempname() String name for a temporary file
23602360
test_alloc_fail({id}, {countdown}, {repeat})
23612361
none make memory allocation fail
23622362
test_autochdir() none enable 'autochdir' during startup
2363-
test_disable_char_avail({expr}) none test without typeahead
23642363
test_garbagecollect_now() none free memory right now for testing
23652364
test_ignore_error({expr}) none ignore a specific error
23662365
test_null_channel() Channel null value for testing
@@ -2369,6 +2368,7 @@ test_null_job() Job null value for testing
23692368
test_null_list() List null value for testing
23702369
test_null_partial() Funcref null value for testing
23712370
test_null_string() String null value for testing
2371+
test_override({expr}, {val}) none test with Vim internal overrides
23722372
test_settime({expr}) none set current time for testing
23732373
timer_info([{id}]) List information about timers
23742374
timer_pause({id}, {pause}) none pause or unpause a timer

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,7 @@ test_arglist \
21282128
test_digraph \
21292129
test_functions \
21302130
test_display \
2131+
test_edit \
21312132
test_ex_undo \
21322133
test_execute_func \
21332134
test_expand \

src/auto/configure

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,22 +4124,29 @@ if test "$GCC" = yes; then
41244124
fi
41254125
fi
41264126

4127-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for recent clang version" >&5
4128-
$as_echo_n "checking for recent clang version... " >&6; }
4129-
CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p'`
4127+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang version" >&5
4128+
$as_echo_n "checking for clang version... " >&6; }
4129+
CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p'`
41304130
if test x"$CLANG_VERSION_STRING" != x"" ; then
41314131
CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/p'`
41324132
CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/p'`
41334133
CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/p'`
41344134
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
41354135
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5
41364136
$as_echo "$CLANG_VERSION" >&6; }
4137-
if test "$CLANG_VERSION" -ge 500002075 ; then
4138-
CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
4137+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5
4138+
$as_echo_n "checking if clang supports -fno-strength-reduce... " >&6; }
4139+
if test "$CLANG_VERSION" -ge 500002075 ; then
4140+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4141+
$as_echo "no" >&6; }
4142+
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
4143+
else
4144+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4145+
$as_echo "yes" >&6; }
41394146
fi
41404147
else
4141-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4142-
$as_echo "no" >&6; }
4148+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: N/A" >&5
4149+
$as_echo "N/A" >&6; }
41434150
fi
41444151

41454152
CROSS_COMPILING=
@@ -10218,6 +10225,18 @@ fi
1021810225

1021910226

1022010227

10228+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/self/exe" >&5
10229+
$as_echo_n "checking for /proc/self/exe... " >&6; }
10230+
if test -L "/proc/self/exe"; then
10231+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10232+
$as_echo "yes" >&6; }
10233+
$as_echo "#define HAVE_PROC_SELF_EXE 1" >>confdefs.h
10234+
10235+
else
10236+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10237+
$as_echo "no" >&6; }
10238+
fi
10239+
1022110240
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN or MSYS environment" >&5
1022210241
$as_echo_n "checking for CYGWIN or MSYS environment... " >&6; }
1022310242
case `uname` in

src/configure.ac

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
6767
dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
6868
dnl the version number of the clang in use.
6969
dnl Note that this does not work to get the version of clang 3.1 or 3.2.
70-
AC_MSG_CHECKING(for recent clang version)
71-
CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
70+
AC_MSG_CHECKING(for clang version)
71+
CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang[[^0-9]]*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
7272
if test x"$CLANG_VERSION_STRING" != x"" ; then
7373
CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
7474
CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
@@ -79,11 +79,15 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then
7979
dnl change the constant 500002075 below appropriately. To get the
8080
dnl integer corresponding to a version number, refer to the
8181
dnl definition of CLANG_VERSION above.
82+
AC_MSG_CHECKING(if clang supports -fno-strength-reduce)
8283
if test "$CLANG_VERSION" -ge 500002075 ; then
83-
CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
84+
AC_MSG_RESULT(no)
85+
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
86+
else
87+
AC_MSG_RESULT(yes)
8488
fi
8589
else
86-
AC_MSG_RESULT(no)
90+
AC_MSG_RESULT(N/A)
8791
fi
8892

8993
dnl If configure thinks we are cross compiling, there might be something
@@ -3101,6 +3105,14 @@ dnl ---------------------------------------------------------------------------
31013105
dnl end of GUI-checking
31023106
dnl ---------------------------------------------------------------------------
31033107

3108+
AC_MSG_CHECKING([for /proc/self/exe])
3109+
if test -L "/proc/self/exe"; then
3110+
AC_MSG_RESULT(yes)
3111+
AC_DEFINE(HAVE_PROC_SELF_EXE)
3112+
else
3113+
AC_MSG_RESULT(no)
3114+
fi
3115+
31043116
dnl Check for Cygwin, which needs an extra source file if not using X11
31053117
AC_MSG_CHECKING(for CYGWIN or MSYS environment)
31063118
case `uname` in

src/diff.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,12 @@ ex_diffpatch(exarg_T *eap)
977977
{
978978
/* Build the patch command and execute it. Ignore errors. Switch to
979979
* cooked mode to allow the user to respond to prompts. */
980-
vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
980+
vim_snprintf((char *)buf, buflen,
981+
#ifdef UNIX
982+
"patch -o %s %s < '%s'",
983+
#else
984+
"patch -o %s %s < \"%s\"",
985+
#endif
981986
tmp_new, tmp_orig,
982987
# ifdef UNIX
983988
fullname != NULL ? fullname :

src/edit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,10 @@ has_compl_option(int dict_opt)
22712271
vim_beep(BO_COMPL);
22722272
setcursor();
22732273
out_flush();
2274-
ui_delay(2000L, FALSE);
2274+
#ifdef FEAT_EVAL
2275+
if (!get_vim_var_nr(VV_TESTING))
2276+
#endif
2277+
ui_delay(2000L, FALSE);
22752278
}
22762279
return FALSE;
22772280
}

src/evalfunc.c

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static void f_tagfiles(typval_T *argvars, typval_T *rettv);
390390
static void f_tempname(typval_T *argvars, typval_T *rettv);
391391
static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv);
392392
static void f_test_autochdir(typval_T *argvars, typval_T *rettv);
393-
static void f_test_disable_char_avail(typval_T *argvars, typval_T *rettv);
393+
static void f_test_override(typval_T *argvars, typval_T *rettv);
394394
static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv);
395395
static void f_test_ignore_error(typval_T *argvars, typval_T *rettv);
396396
#ifdef FEAT_JOB_CHANNEL
@@ -828,7 +828,6 @@ static struct fst
828828
{"tempname", 0, 0, f_tempname},
829829
{"test_alloc_fail", 3, 3, f_test_alloc_fail},
830830
{"test_autochdir", 0, 0, f_test_autochdir},
831-
{"test_disable_char_avail", 1, 1, f_test_disable_char_avail},
832831
{"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now},
833832
{"test_ignore_error", 1, 1, f_test_ignore_error},
834833
#ifdef FEAT_JOB_CHANNEL
@@ -841,6 +840,7 @@ static struct fst
841840
{"test_null_list", 0, 0, f_test_null_list},
842841
{"test_null_partial", 0, 0, f_test_null_partial},
843842
{"test_null_string", 0, 0, f_test_null_string},
843+
{"test_override", 2, 2, f_test_override},
844844
{"test_settime", 1, 1, f_test_settime},
845845
#ifdef FEAT_TIMERS
846846
{"timer_info", 0, 1, f_timer_info},
@@ -12353,12 +12353,34 @@ f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
1235312353
}
1235412354

1235512355
/*
12356-
* "test_disable_char_avail({expr})" function
12356+
* "test_disable({name}, {val})" function
1235712357
*/
1235812358
static void
12359-
f_test_disable_char_avail(typval_T *argvars, typval_T *rettv UNUSED)
12359+
f_test_override(typval_T *argvars, typval_T *rettv UNUSED)
1236012360
{
12361-
disable_char_avail_for_testing = (int)get_tv_number(&argvars[0]);
12361+
char_u *name = (char_u *)"";
12362+
int val;
12363+
12364+
if (argvars[0].v_type != VAR_STRING
12365+
|| (argvars[1].v_type) != VAR_NUMBER)
12366+
EMSG(_(e_invarg));
12367+
else
12368+
{
12369+
name = get_tv_string_chk(&argvars[0]);
12370+
val = (int)get_tv_number(&argvars[1]);
12371+
12372+
if (STRCMP(name, (char_u *)"redraw") == 0)
12373+
disable_redraw_for_testing = val;
12374+
else if (STRCMP(name, (char_u *)"char_avail") == 0)
12375+
disable_char_avail_for_testing = val;
12376+
else if (STRCMP(name, (char_u *)"ALL") == 0)
12377+
{
12378+
disable_char_avail_for_testing = FALSE;
12379+
disable_redraw_for_testing = FALSE;
12380+
}
12381+
else
12382+
EMSG2(_(e_invarg2), name);
12383+
}
1236212384
}
1236312385

1236412386
/*

src/ex_cmds2.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2905,8 +2905,15 @@ ex_argdelete(exarg_T *eap)
29052905
if (eap->line2 > ARGCOUNT)
29062906
eap->line2 = ARGCOUNT;
29072907
n = eap->line2 - eap->line1 + 1;
2908-
if (*eap->arg != NUL || n <= 0)
2908+
if (*eap->arg != NUL)
2909+
/* Can't have both a range and an argument. */
29092910
EMSG(_(e_invarg));
2911+
else if (n <= 0)
2912+
{
2913+
/* Don't give an error for ":%argdel" if the list is empty. */
2914+
if (eap->line1 != 1 || eap->line2 != 0)
2915+
EMSG(_(e_invrange));
2916+
}
29102917
else
29112918
{
29122919
for (i = eap->line1; i <= eap->line2; ++i)

src/globals.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,9 @@ EXTERN int alloc_fail_countdown INIT(= -1);
16521652
/* set by alloc_fail(), number of times alloc() returns NULL */
16531653
EXTERN int alloc_fail_repeat INIT(= 0);
16541654

1655+
/* flags set by test_override() */
16551656
EXTERN int disable_char_avail_for_testing INIT(= 0);
1657+
EXTERN int disable_redraw_for_testing INIT(= 0);
16561658

16571659
EXTERN int in_free_unref_items INIT(= FALSE);
16581660
#endif

src/option.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,22 +4240,13 @@ set_init_3(void)
42404240
options[idx3].def_val[VI_DEFAULT] = p_shcf;
42414241
}
42424242

4243-
# ifdef WIN3264
42444243
/* Somehow Win32 requires the quotes around the redirection too */
42454244
idx3 = findoption((char_u *)"sxq");
42464245
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
42474246
{
42484247
p_sxq = (char_u *)"\"";
42494248
options[idx3].def_val[VI_DEFAULT] = p_sxq;
42504249
}
4251-
# else
4252-
idx3 = findoption((char_u *)"shq");
4253-
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
4254-
{
4255-
p_shq = (char_u *)"\"";
4256-
options[idx3].def_val[VI_DEFAULT] = p_shq;
4257-
}
4258-
# endif
42594250
}
42604251
else if (strstr((char *)gettail(p_sh), "cmd.exe") != NULL)
42614252
{

0 commit comments

Comments
 (0)