From e9c07270031e312082604d3505650f185aa65948 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 30 Mar 2016 20:50:46 +0200 Subject: [PATCH 1/4] patch 7.4.1686 Problem: When running tests $HOME/.viminfo is written. (James McCoy) Solution: Add 'nviminfo' to the 'viminfo' option. (closes #722) --- src/testdir/runtest.vim | 4 +++- src/testdir/test_backspace_opt.vim | 2 +- src/testdir/test_viminfo.vim | 2 +- src/version.c | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 0cf50006db..4d75af3ee9 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -55,6 +55,9 @@ lang mess C " Always use forward slashes. set shellslash +" Make sure $HOME does not get read or written. +let $HOME = '/does/not/exist' + let s:srcdir = expand('%:p:h:h') " Support function: get the alloc ID by name. @@ -141,7 +144,6 @@ for s:test in sort(s:tests) call extend(s:errors, v:errors) let v:errors = [] endif - endfor if s:fail == 0 diff --git a/src/testdir/test_backspace_opt.vim b/src/testdir/test_backspace_opt.vim index f80e831e9a..7fbba96c66 100644 --- a/src/testdir/test_backspace_opt.vim +++ b/src/testdir/test_backspace_opt.vim @@ -53,7 +53,7 @@ func Test_backspace_option() " Cleared when 'compatible' is set set compatible call assert_equal('', &backspace) - set nocompatible + set nocompatible viminfo+=nviminfo endfunc " vim: tabstop=2 shiftwidth=0 expandtab diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim index 3efe75e826..a979ab9967 100644 --- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -36,7 +36,7 @@ func Test_global_vars() " store a really long list, so line wrapping will occur in viminfo file let test_list = range(1,100) let g:MY_GLOBAL_LIST = test_list - set viminfo='100,<50,s10,h,! + set viminfo='100,<50,s10,h,!,nviminfo wv! Xviminfo unlet g:MY_GLOBAL_DICT unlet g:MY_GLOBAL_LIST diff --git a/src/version.c b/src/version.c index 1b34431723..f2976cb22f 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1686, /**/ 1685, /**/ From bdf0bda968a53a55149a4c83a10a60c28e431305 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 30 Mar 2016 21:06:57 +0200 Subject: [PATCH 2/4] patch 7.4.1687 Problem: The channel close_cb option does not work. Solution: Use jo_close_partial instead of jo_err_partial. (Damien) --- src/channel.c | 2 +- src/testdir/test_channel.vim | 23 +++++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/channel.c b/src/channel.c index 98bc6be63b..b21c4432cc 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1103,7 +1103,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt) *cbp = vim_strsave(opt->jo_close_cb); else *cbp = NULL; - *pp = opt->jo_err_partial; + *pp = opt->jo_close_partial; if (*pp != NULL) ++(*pp)->pt_refcount; } diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 5e34ad2ca1..119f71a355 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1203,6 +1203,29 @@ func Test_close_callback() call s:run_server('s:test_close_callback') endfunc +function s:test_close_partial(port) + let handle = ch_open('localhost:' . a:port, s:chopt) + if ch_status(handle) == "fail" + call assert_false(1, "Can't open channel") + return + endif + let s:d = {} + func s:d.closeCb(ch) dict + let self.close_ret = 'closed' + endfunc + call ch_setoptions(handle, {'close_cb': s:d.closeCb}) + + call assert_equal('', ch_evalexpr(handle, 'close me')) + call s:waitFor('"closed" == s:d.close_ret') + call assert_equal('closed', s:d.close_ret) + unlet s:d +endfunc + +func Test_close_partial() + call ch_log('Test_close_partial()') + call s:run_server('s:test_close_partial') +endfunc + func Test_job_start_invalid() call assert_fails('call job_start($x)', 'E474:') call assert_fails('call job_start("")', 'E474:') diff --git a/src/version.c b/src/version.c index f2976cb22f..6e599d813a 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1687, /**/ 1686, /**/ From 67c2c058ea34628bd575aac7ddba4cd3b244ed57 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 30 Mar 2016 22:03:02 +0200 Subject: [PATCH 3/4] patch 7.4.1688 Problem: MzScheme does not support partial. Solution: Add minimal partial support. (Ken Takata) --- src/if_mzsch.c | 25 +++++++++++++++++++++++++ src/version.c | 2 ++ 2 files changed, 27 insertions(+) diff --git a/src/if_mzsch.c b/src/if_mzsch.c index d255d4adf1..93e4b6cbba 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -3109,6 +3109,7 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited) MZ_GC_VAR_IN_REG(0, funcname); MZ_GC_REG(); + /* FIXME: func_ref() and func_unref() are needed. */ funcname = scheme_make_byte_string((char *)vim_value->vval.v_string); MZ_GC_CHECK(); 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) MZ_GC_UNREG(); } + else if (vim_value->v_type == VAR_PARTIAL) + { + if (vim_value->vval.v_partial == NULL) + result = scheme_null; + else + { + Scheme_Object *funcname = NULL; + + MZ_GC_DECL_REG(1); + MZ_GC_VAR_IN_REG(0, funcname); + MZ_GC_REG(); + + /* FIXME: func_ref() and func_unref() are needed. */ + /* TODO: Support pt_dict and pt_argv. */ + funcname = scheme_make_byte_string( + (char *)vim_value->vval.v_partial->pt_name); + MZ_GC_CHECK(); + result = scheme_make_closed_prim_w_arity(vim_funcref, funcname, + (const char *)BYTE_STRING_VALUE(funcname), 0, -1); + MZ_GC_CHECK(); + + MZ_GC_UNREG(); + } + } else if (vim_value->v_type == VAR_SPECIAL) { if (vim_value->vval.v_number <= VVAL_TRUE) diff --git a/src/version.c b/src/version.c index 6e599d813a..c7e1639d42 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1688, /**/ 1687, /**/ From 758535a1df4c5e86b45dddf12db2a54dea28ca40 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 30 Mar 2016 22:06:16 +0200 Subject: [PATCH 4/4] patch 7.4.1689 Problem: Ruby interface has inconsistent coding style. Solution: Fix the coding style. (Ken Takata) --- src/if_ruby.c | 36 ++++++++++++++++++++++++------------ src/version.c | 2 ++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index a7a7772e3e..80ffa49d31 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -731,7 +731,8 @@ vim_str2rb_enc_str(const char *s) { enc = rb_enc_find((char *)sval); vim_free(sval); - if (enc) { + if (enc) + { return rb_enc_str_new(s, strlen(s), enc); } } @@ -773,19 +774,23 @@ void ex_rubydo(exarg_T *eap) { if (u_save(eap->line1 - 1, eap->line2 + 1) != OK) return; - for (i = eap->line1; i <= eap->line2; i++) { + for (i = eap->line1; i <= eap->line2; i++) + { VALUE line; line = vim_str2rb_enc_str((char *)ml_get(i)); rb_lastline_set(line); eval_enc_string_protect((char *) eap->arg, &state); - if (state) { + if (state) + { error_print(state); break; } line = rb_lastline_get(); - if (!NIL_P(line)) { - if (TYPE(line) != T_STRING) { + if (!NIL_P(line)) + { + if (TYPE(line) != T_STRING) + { EMSG(_("E265: $_ must be an instance of String")); return; } @@ -898,7 +903,8 @@ static void error_print(int state) #define TAG_FATAL 0x8 #define TAG_MASK 0xf - switch (state) { + switch (state) + { case TAG_RETURN: EMSG(_("E267: unexpected return")); break; @@ -923,10 +929,12 @@ static void error_print(int state) eclass = CLASS_OF(ruby_errinfo); einfo = rb_obj_as_string(ruby_errinfo); #endif - if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) { + if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) + { EMSG(_("E272: unhandled exception")); } - else { + else + { VALUE epath; char *p; @@ -1208,7 +1216,8 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str) /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); - if (u_savesub(n) == OK) { + if (u_savesub(n) == OK) + { ml_replace(n, (char_u *)line, TRUE); changed(); #ifdef SYNTAX_HL @@ -1249,7 +1258,8 @@ static VALUE buffer_delete(VALUE self, VALUE num) /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); - if (u_savedel(n, 1) == OK) { + if (u_savedel(n, 1) == OK) + { ml_delete(n, 0); /* Changes to non-active buffers should properly refresh @@ -1288,7 +1298,8 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str) /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); - if (u_inssub(n + 1) == OK) { + if (u_inssub(n + 1) == OK) + { ml_append(n, (char_u *) line, (colnr_T) 0, FALSE); /* Changes to non-active buffers should properly refresh screen @@ -1494,7 +1505,8 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED) int i; VALUE str = rb_str_new("", 0); - for (i = 0; i < argc; i++) { + for (i = 0; i < argc; i++) + { if (i > 0) rb_str_cat(str, ", ", 2); rb_str_concat(str, rb_inspect(argv[i])); } diff --git a/src/version.c b/src/version.c index c7e1639d42..8d32e2a0d3 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1689, /**/ 1688, /**/