Skip to content

Commit 89f8880

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents a8c2fa5 + 19a1669 commit 89f8880

29 files changed

Lines changed: 390 additions & 164 deletions

runtime/doc/channel.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Aug 31
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Sep 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -501,6 +501,10 @@ A special mode is when "in_top" is set to zero and "in_bot" is not set: Every
501501
time a line is added to the buffer, the last-but-one line will be send to the
502502
job stdin. This allows for editing the last line and sending it when pressing
503503
Enter.
504+
*channel-close-in*
505+
When not using the special mode the pipe or socket will be closed after the
506+
last line has been written. This signals the reading end that the input
507+
finished. You can also use |ch_close_in()| to close it sooner.
504508

505509
NUL bytes in the text will be passed to the job (internally Vim stores these
506510
as NL bytes).

runtime/doc/eval.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Aug 31
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Sep 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2009,6 +2009,7 @@ call({func}, {arglist} [, {dict}])
20092009
any call {func} with arguments {arglist}
20102010
ceil({expr}) Float round {expr} up
20112011
ch_close({handle}) none close {handle}
2012+
ch_close_in({handle}) none close in part of {handle}
20122013
ch_evalexpr({handle}, {expr} [, {options}])
20132014
any evaluate {expr} on JSON {handle}
20142015
ch_evalraw({handle}, {string} [, {options}])
@@ -2980,6 +2981,14 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
29802981
ch_close({handle}) *ch_close()*
29812982
Close {handle}. See |channel-close|.
29822983
{handle} can be Channel or a Job that has a Channel.
2984+
A close callback is not invoked.
2985+
2986+
{only available when compiled with the |+channel| feature}
2987+
2988+
ch_close_in({handle}) *ch_close_in()*
2989+
Close the "in" part of {handle}. See |channel-close-in|.
2990+
{handle} can be Channel or a Job that has a Channel.
2991+
A close callback is not invoked.
29832992

29842993
{only available when compiled with the |+channel| feature}
29852994

src/Make_mvc.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ RUBY_PLATFORM = i386-mswin32
934934
!else # CPU
935935
RUBY_PLATFORM = x64-mswin64
936936
!endif # CPU
937-
!if $(MSVCRT_VER) >= 70
937+
!if $(MSVCRT_VER) >= 70 && $(RUBY_VER) > 19
938938
RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER)
939939
!endif # MSVCRT_VER
940940
!endif # RUBY_PLATFORM

src/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,12 +2056,9 @@ test1 \
20562056
test_listchars \
20572057
test_listlbr \
20582058
test_listlbr_utf8 \
2059-
test_marks \
2060-
test_nested_function \
20612059
test_search_mbyte \
20622060
test_utf8 \
20632061
test_wordcount \
2064-
test_writefile \
20652062
test2 test3 test4 test5 test6 test7 test8 test9 \
20662063
test11 test12 test13 test14 test15 test17 test18 test19 \
20672064
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
@@ -2122,11 +2119,13 @@ test_arglist \
21222119
test_lispwords \
21232120
test_man \
21242121
test_mapping \
2122+
test_marks \
21252123
test_match \
21262124
test_matchadd_conceal \
21272125
test_matchadd_conceal_utf8 \
21282126
test_menu \
21292127
test_messages \
2128+
test_nested_function \
21302129
test_netbeans \
21312130
test_options \
21322131
test_packadd \
@@ -2165,6 +2164,7 @@ test_arglist \
21652164
test_visual \
21662165
test_window_cmd \
21672166
test_window_id \
2167+
test_writefile \
21682168
test_alot_latin \
21692169
test_alot_utf8 \
21702170
test_alot:

src/bigvim.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:: command to build big Vim with OLE, Perl, Python, Ruby and Tcl
22
SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\"
33
SET TOOLDIR=E:\
4-
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl522\perl DYNAMIC_PERL=yes PERL_VER=522 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=19 RUBY_VER_LONG=1.9.2 TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes
4+
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=19 RUBY_VER_LONG=1.9.2 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes
55

src/bigvim64.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:: command to build big Vim 64 bit with OLE, Perl, Python, Ruby and Tcl
1+
:: command to build big Vim 64 bit with OLE, Perl and Python.
22
:: First run: %VCDIR%\vcvarsall.bat x86_amd64
33
:: Ruby and Tcl are excluded, doesn't seem to work.
44
SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\"
55
SET TOOLDIR=E:\
6-
%VCDIR%\bin\nmake -f Make_mvc.mak CPU=AMD64 GUI=yes OLE=yes PERL=E:\perl514 DYNAMIC_PERL=yes PERL_VER=514 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python32 DYNAMIC_PYTHON3=yes PYTHON3_VER=32 %1 IME=yes CSCOPE=yes
6+
%VCDIR%\bin\nmake -f Make_mvc.mak CPU=AMD64 GUI=yes OLE=yes PERL=E:\perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 %1 IME=yes CSCOPE=yes
77

src/channel.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,11 +1445,14 @@ channel_write_in(channel_T *channel)
14451445
ch_logn(channel, "written %d lines to channel", written);
14461446

14471447
in_part->ch_buf_top = lnum;
1448-
if (lnum > buf->b_ml.ml_line_count)
1448+
if (lnum > buf->b_ml.ml_line_count || lnum > in_part->ch_buf_bot)
14491449
{
14501450
/* Writing is done, no longer need the buffer. */
14511451
in_part->ch_bufref.br_buf = NULL;
14521452
ch_log(channel, "Finished writing all lines to channel");
1453+
1454+
/* Close the pipe/socket, so that the other side gets EOF. */
1455+
may_close_part(&channel->CH_IN_FD);
14531456
}
14541457
else
14551458
ch_logn(channel, "Still %d more lines to write",
@@ -2753,6 +2756,15 @@ channel_close(channel_T *channel, int invoke_close_cb)
27532756
channel->ch_nb_close_cb = NULL;
27542757
}
27552758

2759+
/*
2760+
* Close the "in" part channel "channel".
2761+
*/
2762+
void
2763+
channel_close_in(channel_T *channel)
2764+
{
2765+
may_close_part(&channel->CH_IN_FD);
2766+
}
2767+
27562768
/*
27572769
* Clear the read buffer on "channel"/"part".
27582770
*/

src/evalfunc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static void f_ceil(typval_T *argvars, typval_T *rettv);
7777
#endif
7878
#ifdef FEAT_JOB_CHANNEL
7979
static void f_ch_close(typval_T *argvars, typval_T *rettv);
80+
static void f_ch_close_in(typval_T *argvars, typval_T *rettv);
8081
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
8182
static void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
8283
static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
@@ -499,6 +500,7 @@ static struct fst
499500
#endif
500501
#ifdef FEAT_JOB_CHANNEL
501502
{"ch_close", 1, 1, f_ch_close},
503+
{"ch_close_in", 1, 1, f_ch_close_in},
502504
{"ch_evalexpr", 2, 3, f_ch_evalexpr},
503505
{"ch_evalraw", 2, 3, f_ch_evalraw},
504506
{"ch_getbufnr", 2, 2, f_ch_getbufnr},
@@ -1791,6 +1793,18 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
17911793
}
17921794
}
17931795

1796+
/*
1797+
* "ch_close()" function
1798+
*/
1799+
static void
1800+
f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED)
1801+
{
1802+
channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
1803+
1804+
if (channel != NULL)
1805+
channel_close_in(channel);
1806+
}
1807+
17941808
/*
17951809
* "ch_getbufnr()" function
17961810
*/

src/ex_cmds2.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,9 @@ profile_zero(proftime_T *tm)
10901090
static timer_T *first_timer = NULL;
10911091
static int last_timer_id = 0;
10921092

1093+
static timer_T *current_timer = NULL;
1094+
static int free_current_timer = FALSE;
1095+
10931096
/*
10941097
* Insert a timer in the list of timers.
10951098
*/
@@ -1121,8 +1124,13 @@ remove_timer(timer_T *timer)
11211124
static void
11221125
free_timer(timer_T *timer)
11231126
{
1124-
free_callback(timer->tr_callback, timer->tr_partial);
1125-
vim_free(timer);
1127+
if (timer == current_timer)
1128+
free_current_timer = TRUE;
1129+
else
1130+
{
1131+
free_callback(timer->tr_callback, timer->tr_partial);
1132+
vim_free(timer);
1133+
}
11261134
}
11271135

11281136
/*
@@ -1200,18 +1208,23 @@ check_due_timer(void)
12001208
# endif
12011209
if (this_due <= 1)
12021210
{
1203-
remove_timer(timer);
1211+
current_timer = timer;
1212+
free_current_timer = FALSE;
12041213
timer_callback(timer);
1214+
current_timer = NULL;
1215+
12051216
did_one = TRUE;
1206-
if (timer->tr_repeat != 0)
1217+
if (timer->tr_repeat != 0 && !free_current_timer)
12071218
{
12081219
profile_setlimit(timer->tr_interval, &timer->tr_due);
12091220
if (timer->tr_repeat > 0)
12101221
--timer->tr_repeat;
1211-
insert_timer(timer);
12121222
}
12131223
else
1224+
{
12141225
free_timer(timer);
1226+
remove_timer(timer);
1227+
}
12151228
/* the callback may do anything, start all over */
12161229
break;
12171230
}

src/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8056,7 +8056,7 @@ au_del_group(char_u *name)
80568056
event = (event_T)((int)event + 1))
80578057
{
80588058
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
8059-
if (ap->group == i)
8059+
if (ap->group == i && ap->pat != NULL)
80608060
{
80618061
give_warning((char_u *)_("W19: Deleting augroup that is still in use"), TRUE);
80628062
in_use = TRUE;

0 commit comments

Comments
 (0)