Skip to content

Commit 4005cc7

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 4d59b3c + 758535a commit 4005cc7

8 files changed

+86
-16
lines changed

src/channel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
11221122
*cbp = vim_strsave(opt->jo_close_cb);
11231123
else
11241124
*cbp = NULL;
1125-
*pp = opt->jo_err_partial;
1125+
*pp = opt->jo_close_partial;
11261126
if (*pp != NULL)
11271127
++(*pp)->pt_refcount;
11281128
}

src/if_mzsch.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,6 +3109,7 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
31093109
MZ_GC_VAR_IN_REG(0, funcname);
31103110
MZ_GC_REG();
31113111

3112+
/* FIXME: func_ref() and func_unref() are needed. */
31123113
funcname = scheme_make_byte_string((char *)vim_value->vval.v_string);
31133114
MZ_GC_CHECK();
31143115
result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
@@ -3117,6 +3118,30 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
31173118

31183119
MZ_GC_UNREG();
31193120
}
3121+
else if (vim_value->v_type == VAR_PARTIAL)
3122+
{
3123+
if (vim_value->vval.v_partial == NULL)
3124+
result = scheme_null;
3125+
else
3126+
{
3127+
Scheme_Object *funcname = NULL;
3128+
3129+
MZ_GC_DECL_REG(1);
3130+
MZ_GC_VAR_IN_REG(0, funcname);
3131+
MZ_GC_REG();
3132+
3133+
/* FIXME: func_ref() and func_unref() are needed. */
3134+
/* TODO: Support pt_dict and pt_argv. */
3135+
funcname = scheme_make_byte_string(
3136+
(char *)vim_value->vval.v_partial->pt_name);
3137+
MZ_GC_CHECK();
3138+
result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
3139+
(const char *)BYTE_STRING_VALUE(funcname), 0, -1);
3140+
MZ_GC_CHECK();
3141+
3142+
MZ_GC_UNREG();
3143+
}
3144+
}
31203145
else if (vim_value->v_type == VAR_SPECIAL)
31213146
{
31223147
if (vim_value->vval.v_number <= VVAL_TRUE)

src/if_ruby.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@ vim_str2rb_enc_str(const char *s)
739739
{
740740
enc = rb_enc_find((char *)sval);
741741
vim_free(sval);
742-
if (enc) {
742+
if (enc)
743+
{
743744
return rb_enc_str_new(s, strlen(s), enc);
744745
}
745746
}
@@ -781,19 +782,23 @@ void ex_rubydo(exarg_T *eap)
781782
{
782783
if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
783784
return;
784-
for (i = eap->line1; i <= eap->line2; i++) {
785+
for (i = eap->line1; i <= eap->line2; i++)
786+
{
785787
VALUE line;
786788

787789
line = vim_str2rb_enc_str((char *)ml_get(i));
788790
rb_lastline_set(line);
789791
eval_enc_string_protect((char *) eap->arg, &state);
790-
if (state) {
792+
if (state)
793+
{
791794
error_print(state);
792795
break;
793796
}
794797
line = rb_lastline_get();
795-
if (!NIL_P(line)) {
796-
if (TYPE(line) != T_STRING) {
798+
if (!NIL_P(line))
799+
{
800+
if (TYPE(line) != T_STRING)
801+
{
797802
EMSG(_("E265: $_ must be an instance of String"));
798803
return;
799804
}
@@ -906,7 +911,8 @@ static void error_print(int state)
906911
#define TAG_FATAL 0x8
907912
#define TAG_MASK 0xf
908913

909-
switch (state) {
914+
switch (state)
915+
{
910916
case TAG_RETURN:
911917
EMSG(_("E267: unexpected return"));
912918
break;
@@ -931,10 +937,12 @@ static void error_print(int state)
931937
eclass = CLASS_OF(ruby_errinfo);
932938
einfo = rb_obj_as_string(ruby_errinfo);
933939
#endif
934-
if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) {
940+
if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0)
941+
{
935942
EMSG(_("E272: unhandled exception"));
936943
}
937-
else {
944+
else
945+
{
938946
VALUE epath;
939947
char *p;
940948

@@ -1216,7 +1224,8 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
12161224
/* set curwin/curbuf for "buf" and save some things */
12171225
aucmd_prepbuf(&aco, buf);
12181226

1219-
if (u_savesub(n) == OK) {
1227+
if (u_savesub(n) == OK)
1228+
{
12201229
ml_replace(n, (char_u *)line, TRUE);
12211230
changed();
12221231
#ifdef SYNTAX_HL
@@ -1257,7 +1266,8 @@ static VALUE buffer_delete(VALUE self, VALUE num)
12571266
/* set curwin/curbuf for "buf" and save some things */
12581267
aucmd_prepbuf(&aco, buf);
12591268

1260-
if (u_savedel(n, 1) == OK) {
1269+
if (u_savedel(n, 1) == OK)
1270+
{
12611271
ml_delete(n, 0);
12621272

12631273
/* Changes to non-active buffers should properly refresh
@@ -1296,7 +1306,8 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
12961306
/* set curwin/curbuf for "buf" and save some things */
12971307
aucmd_prepbuf(&aco, buf);
12981308

1299-
if (u_inssub(n + 1) == OK) {
1309+
if (u_inssub(n + 1) == OK)
1310+
{
13001311
ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
13011312

13021313
/* Changes to non-active buffers should properly refresh screen
@@ -1502,7 +1513,8 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
15021513
int i;
15031514
VALUE str = rb_str_new("", 0);
15041515

1505-
for (i = 0; i < argc; i++) {
1516+
for (i = 0; i < argc; i++)
1517+
{
15061518
if (i > 0) rb_str_cat(str, ", ", 2);
15071519
rb_str_concat(str, rb_inspect(argv[i]));
15081520
}

src/testdir/runtest.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ lang mess C
5555
" Always use forward slashes.
5656
set shellslash
5757

58+
" Make sure $HOME does not get read or written.
59+
let $HOME = '/does/not/exist'
60+
5861
let s:srcdir = expand('%:p:h:h')
5962

6063
" Support function: get the alloc ID by name.
@@ -141,7 +144,6 @@ for s:test in sort(s:tests)
141144
call extend(s:errors, v:errors)
142145
let v:errors = []
143146
endif
144-
145147
endfor
146148

147149
if s:fail == 0

src/testdir/test_backspace_opt.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func Test_backspace_option()
5353
" Cleared when 'compatible' is set
5454
set compatible
5555
call assert_equal('', &backspace)
56-
set nocompatible
56+
set nocompatible viminfo+=nviminfo
5757
endfunc
5858

5959
" vim: tabstop=2 shiftwidth=0 expandtab

src/testdir/test_channel.vim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,29 @@ func Test_close_callback()
12031203
call s:run_server('s:test_close_callback')
12041204
endfunc
12051205

1206+
function s:test_close_partial(port)
1207+
let handle = ch_open('localhost:' . a:port, s:chopt)
1208+
if ch_status(handle) == "fail"
1209+
call assert_false(1, "Can't open channel")
1210+
return
1211+
endif
1212+
let s:d = {}
1213+
func s:d.closeCb(ch) dict
1214+
let self.close_ret = 'closed'
1215+
endfunc
1216+
call ch_setoptions(handle, {'close_cb': s:d.closeCb})
1217+
1218+
call assert_equal('', ch_evalexpr(handle, 'close me'))
1219+
call s:waitFor('"closed" == s:d.close_ret')
1220+
call assert_equal('closed', s:d.close_ret)
1221+
unlet s:d
1222+
endfunc
1223+
1224+
func Test_close_partial()
1225+
call ch_log('Test_close_partial()')
1226+
call s:run_server('s:test_close_partial')
1227+
endfunc
1228+
12061229
func Test_job_start_invalid()
12071230
call assert_fails('call job_start($x)', 'E474:')
12081231
call assert_fails('call job_start("")', 'E474:')

src/testdir/test_viminfo.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func Test_global_vars()
3636
" store a really long list, so line wrapping will occur in viminfo file
3737
let test_list = range(1,100)
3838
let g:MY_GLOBAL_LIST = test_list
39-
set viminfo='100,<50,s10,h,!
39+
set viminfo='100,<50,s10,h,!,nviminfo
4040
wv! Xviminfo
4141
unlet g:MY_GLOBAL_DICT
4242
unlet g:MY_GLOBAL_LIST

src/version.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,14 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
1689,
768+
/**/
769+
1688,
770+
/**/
771+
1687,
772+
/**/
773+
1686,
766774
/**/
767775
1685,
768776
/**/

0 commit comments

Comments
 (0)