Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2016-02-29 20:50:46 -08:00
12 changed files with 195 additions and 34 deletions
+65 -1
View File
@@ -11969,7 +11969,7 @@ for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
usleep utime utimes isnan isinf
usleep utime utimes
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -12490,6 +12490,70 @@ if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT_FUNCS 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf()" >&5
$as_echo_n "checking for isinf()... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
int
main ()
{
int r = isinf(1.11);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_ISINF 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan()" >&5
$as_echo_n "checking for isnan()... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
int
main ()
{
int r = isnan(1.11);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+29 -24
View File
@@ -945,8 +945,9 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
if ((opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER)
{
/* writing output to a buffer. Force mode to NL. */
channel->ch_part[PART_OUT].ch_mode = MODE_NL;
/* writing output to a buffer. Default mode is NL. */
if (!(opt->jo_set & JO_OUT_MODE))
channel->ch_part[PART_OUT].ch_mode = MODE_NL;
channel->ch_part[PART_OUT].ch_buffer =
find_buffer(opt->jo_io_name[PART_OUT]);
ch_logs(channel, "writing to buffer '%s'",
@@ -1579,32 +1580,38 @@ may_invoke_callback(channel_T *channel, int part)
u_sync(TRUE);
u_save(lnum, lnum + 1);
ml_append(lnum, msg, 0, FALSE);
appended_lines_mark(lnum, 1L);
curbuf = save_curbuf;
if (buffer->b_nwindows > 0)
if (msg == NULL)
/* JSON or JS mode: re-encode the message. */
msg = json_encode(listtv, ch_mode);
if (msg != NULL)
{
win_T *wp;
win_T *save_curwin;
ml_append(lnum, msg, 0, FALSE);
appended_lines_mark(lnum, 1L);
curbuf = save_curbuf;
FOR_ALL_WINDOWS(wp)
if (buffer->b_nwindows > 0)
{
if (wp->w_buffer == buffer
&& wp->w_cursor.lnum == lnum
&& wp->w_cursor.col == 0)
win_T *wp;
win_T *save_curwin;
FOR_ALL_WINDOWS(wp)
{
++wp->w_cursor.lnum;
save_curwin = curwin;
curwin = wp;
curbuf = curwin->w_buffer;
scroll_cursor_bot(0, FALSE);
curwin = save_curwin;
curbuf = curwin->w_buffer;
if (wp->w_buffer == buffer
&& wp->w_cursor.lnum == lnum
&& wp->w_cursor.col == 0)
{
++wp->w_cursor.lnum;
save_curwin = curwin;
curwin = wp;
curbuf = curwin->w_buffer;
scroll_cursor_bot(0, FALSE);
curwin = save_curwin;
curbuf = curwin->w_buffer;
}
}
redraw_buf_later(buffer, VALID);
channel_need_redraw = TRUE;
}
redraw_buf_later(buffer, VALID);
channel_need_redraw = TRUE;
}
}
if (callback != NULL)
@@ -1614,8 +1621,6 @@ may_invoke_callback(channel_T *channel, int part)
invoke_callback(channel, callback, argv);
}
}
else if (msg != NULL)
ch_logs(channel, "Dropping message '%s'", (char *)msg);
else
ch_log(channel, "Dropping message");
+28 -1
View File
@@ -3639,7 +3639,7 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
usleep utime utimes isnan isinf)
usleep utime utimes)
AC_FUNC_FSEEKO
dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
@@ -3742,6 +3742,33 @@ AC_TRY_LINK([
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
AC_MSG_RESULT(no))
dnl isinf() and isnan() need to include header files and may need -lm.
AC_MSG_CHECKING([for isinf()])
AC_TRY_LINK([
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
], [int r = isinf(1.11); ],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF),
AC_MSG_RESULT(no))
AC_MSG_CHECKING([for isnan()])
AC_TRY_LINK([
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
], [int r = isnan(1.11); ],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN),
AC_MSG_RESULT(no))
dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
dnl when -lacl works, also try to use -lattr (required for Debian).
dnl On Solaris, use the acl_get/set functions in libsec, if present.
+16 -3
View File
@@ -8415,7 +8415,9 @@ static struct fst
{"range", 1, 3, f_range},
{"readfile", 1, 3, f_readfile},
{"reltime", 0, 2, f_reltime},
#ifdef FEAT_FLOAT
{"reltimefloat", 1, 1, f_reltimefloat},
#endif
{"reltimestr", 1, 1, f_reltimestr},
{"remote_expr", 2, 3, f_remote_expr},
{"remote_foreground", 1, 1, f_remote_foreground},
@@ -15156,7 +15158,8 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
#ifdef USE_ARGV
argv[argc++] = (char *)s;
#else
if (li != l->lv_first)
/* Only escape when needed, double quotes are not always allowed. */
if (li != l->lv_first && vim_strpbrk(s, (char_u *)" \t\"") != NULL)
{
s = vim_strsave_shellescape(s, FALSE, TRUE);
if (s == NULL)
@@ -19221,11 +19224,21 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
goto theend; /* type error; errmsg already given */
if (i == 1)
info.item_compare_ic = TRUE;
else
else if (argvars[1].v_type != VAR_NUMBER)
info.item_compare_func = get_tv_string(&argvars[1]);
else if (i != 0)
{
EMSG(_(e_invarg));
goto theend;
}
if (info.item_compare_func != NULL)
{
if (STRCMP(info.item_compare_func, "n") == 0)
if (*info.item_compare_func == NUL)
{
/* empty string means default sort */
info.item_compare_func = NULL;
}
else if (STRCMP(info.item_compare_func, "n") == 0)
{
info.item_compare_func = NULL;
info.item_compare_numeric = TRUE;
+1 -1
View File
@@ -733,9 +733,9 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
default:
if (VIM_ISDIGIT(*p) || *p == '-')
{
#ifdef FEAT_FLOAT
char_u *sp = p;
#ifdef FEAT_FLOAT
if (*sp == '-')
{
++sp;
+2 -1
View File
@@ -1729,13 +1729,14 @@ vim_memcmp(void *b1, void *b2, size_t len)
}
#endif
/* skipped when generating prototypes, the prototype is in vim.h */
#ifdef VIM_MEMMOVE
/*
* Version of memmove() that handles overlapping source and destination.
* For systems that don't have a function that is guaranteed to do that (SYSV).
*/
void
mch_memmove(void *src_arg, *dst_arg, size_t len)
mch_memmove(void *src_arg, void *dst_arg, size_t len)
{
/*
* A void doesn't have a size, we use char pointers.
+2 -2
View File
@@ -6476,14 +6476,14 @@ have_dollars(int num, char_u **file)
}
#endif /* ifndef __EMX__ */
#ifndef HAVE_RENAME
#if !defined(HAVE_RENAME) || defined(PROTO)
/*
* Scaled-down version of rename(), which is missing in Xenix.
* This version can only move regular files and will fail if the
* destination exists.
*/
int
mch_rename(const char *src, *dest)
mch_rename(const char *src, const char *dest)
{
struct stat st;
+1
View File
@@ -66,6 +66,7 @@ int mch_expandpath(garray_T *gap, char_u *path, int flags);
int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags);
int mch_has_exp_wildcard(char_u *p);
int mch_has_wildcard(char_u *p);
int mch_rename(const char *src, const char *dest);
int mch_libcall(char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result);
void setup_term_clip(void);
void start_xterm_trace(int button);
+1 -1
View File
@@ -140,7 +140,7 @@ tgetent(
}
static int
getent(char *tbuf, *term, FILE *termcap, int buflen)
getent(char *tbuf, char *term, FILE *termcap, int buflen)
{
char *tptr;
int tlen = strlen(term);
+26
View File
@@ -426,6 +426,32 @@ func Test_pipe_to_nameless_buffer()
endtry
endfunc
func Test_pipe_to_buffer_json()
if !has('job')
return
endif
call ch_log('Test_pipe_to_buffer_json()')
let job = job_start(s:python . " test_channel_pipe.py",
\ {'out-io': 'buffer', 'out-mode': 'json'})
call assert_equal("run", job_status(job))
try
let handle = job_getchannel(job)
call ch_sendraw(handle, "echo [0, \"hello\"]\n")
call ch_sendraw(handle, "echo [-2, 12.34]\n")
exe ch_getbufnr(handle, "out") . 'sbuf'
for i in range(100)
sleep 10m
if line('$') >= 3
break
endif
endfor
call assert_equal(['Reading from channel output...', '[0,"hello"]', '[-2,12.34]'], getline(1, '$'))
bwipe!
finally
call job_stop(job)
endtry
endfunc
""""""""""
let s:unletResponse = ''
+8
View File
@@ -35,3 +35,11 @@ func Test_sort_nested()
" test ability to call sort() from a compare function
call assert_equal([1, 3, 5], sort([3, 1, 5], 'Compare1'))
endfunc
func Test_sort_default()
" docs say omitted, empty or zero argument sorts on string representation.
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"]))
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"], ''))
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"], 0))
call assert_fails('call sort([3.3, 1, "2"], 3)', "E474")
endfunc
+16
View File
@@ -758,6 +758,22 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1467,
/**/
1466,
/**/
1465,
/**/
1464,
/**/
1463,
/**/
1462,
/**/
1461,
/**/
1460,
/**/
1459,
/**/