From 82593c1a3a2c5e39603ed76819f83b1197c06c8b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 3 Aug 2018 22:03:17 +0200 Subject: [PATCH 1/5] patch 8.1.0236: Ruby build fails when ruby_intern is missing Problem: Ruby build fails when ruby_intern is missing. Solution: Do not use ruby_intern2. (Ken Takata) --- src/if_ruby.c | 17 ++++++++--------- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index bf83c8b965..63f7312503 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -253,11 +253,12 @@ static void ruby_vim_init(void); # define rb_hash_new dll_rb_hash_new # define rb_inspect dll_rb_inspect # define rb_int2inum dll_rb_int2inum -# ifdef RUBY19_OR_LATER -# define rb_intern2 dll_rb_intern2 -# else +# ifndef rb_intern # define rb_intern dll_rb_intern # endif +# ifdef RUBY_CONST_ID_CACHE +# define rb_intern2 dll_rb_intern2 +# endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 18 # define rb_fix2int dll_rb_fix2int @@ -392,10 +393,9 @@ static VALUE (*dll_rb_hash_aset) (VALUE, VALUE, VALUE); static VALUE (*dll_rb_hash_new) (void); static VALUE (*dll_rb_inspect) (VALUE); static VALUE (*dll_rb_int2inum) (long); -# ifdef RUBY19_OR_LATER -static ID (*dll_rb_intern2) (const char*, long); -# else static ID (*dll_rb_intern) (const char*); +# ifdef RUBY_CONST_ID_CACHE +static ID (*dll_rb_intern2) (const char*, long); # endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ static long (*dll_rb_fix2int) (VALUE); @@ -596,10 +596,9 @@ static struct {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new}, {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect}, {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum}, -# ifdef RUBY19_OR_LATER - {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2}, -# else {"rb_intern", (RUBY_PROC*)&dll_rb_intern}, +# ifdef RUBY_CONST_ID_CACHE + {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2}, # endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int}, diff --git a/src/version.c b/src/version.c index f93e099a6c..ec097fd6a7 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 236, /**/ 235, /**/ From 87ea64ca965ca00b3e72776c39355964293f2ace Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Aug 2018 15:13:34 +0200 Subject: [PATCH 2/5] patch 8.1.0237: Ruby on Cygwin doesn't always work Problem: Ruby on Cygwin doesn't always work. Solution: Use LIBRUBY_SO if LIBRUBY_ALIASES isn't set. (Ken Takata) --- src/auto/configure | 3 +++ src/configure.ac | 3 +++ src/version.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/auto/configure b/src/auto/configure index de1fd6059c..0ab7e23020 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -7606,6 +7606,9 @@ $as_echo "$rubyhdrdir" >&6; } if test "$enable_rubyinterp" = "dynamic"; then libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_ALIASES'].split[0]"` + if test -z "$libruby_soname"; then + libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_SO']"` + fi $as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" diff --git a/src/configure.ac b/src/configure.ac index 0d8ea32d34..8994f3c90a 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1956,6 +1956,9 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then AC_DEFINE(FEAT_RUBY) if test "$enable_rubyinterp" = "dynamic"; then libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_ALIASES']].split[[0]]"` + if test -z "$libruby_soname"; then + libruby_soname=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` + fi AC_DEFINE(DYNAMIC_RUBY) RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= diff --git a/src/version.c b/src/version.c index ec097fd6a7..de3a32e5ed 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 237, /**/ 236, /**/ From 7da1fb5532890d9c15cdb5b9bec158f9f9c105a7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Aug 2018 16:54:11 +0200 Subject: [PATCH 3/5] patch 8.1.0238: 'buftype' is cleared when using ":term ++hidden cat" Problem: 'buftype' is cleared when using ":term ++hidden cat". (Marcin Szamotulski) Solution: Set the "options initialized" flag earlier. (closes #3278) --- src/terminal.c | 2 ++ src/testdir/test_terminal.vim | 16 ++++++++++++++++ src/version.c | 2 ++ 3 files changed, 20 insertions(+) diff --git a/src/terminal.c b/src/terminal.c index 22b90c8332..427e027c5b 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -529,6 +529,8 @@ term_start( set_string_option_direct((char_u *)"buftype", -1, (char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0); + // Avoid that 'buftype' is reset when this buffer is entered. + curbuf->b_p_initialized = TRUE; /* Mark the buffer as not modifiable. It can only be made modifiable after * the job finished. */ diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 7ab0cf8ba9..9126324707 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1605,3 +1605,19 @@ func Test_zz2_terminal_guioptions_bang() set guioptions& call delete(filename) endfunc + +func Test_terminal_hidden() + if !has('unix') + return + endif + term ++hidden cat + let bnr = bufnr('$') + call assert_equal('terminal', getbufvar(bnr, '&buftype')) + exe 'sbuf ' . bnr + call assert_equal('terminal', &buftype) + call term_sendkeys(bnr, "asdf\") + call WaitForAssert({-> assert_match('asdf', term_getline(bnr, 2))}) + call term_sendkeys(bnr, "\") + call WaitForAssert({-> assert_equal('finished', term_getstatus(bnr))}) + bwipe! +endfunc diff --git a/src/version.c b/src/version.c index de3a32e5ed..c5f1812566 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 238, /**/ 237, /**/ From 218beb3e96bcb7b20395be3bec6076c767be71a1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Aug 2018 17:24:44 +0200 Subject: [PATCH 4/5] patch 8.1.0239: now Ruby build fails on other systems Problem: Now Ruby build fails on other systems. Solution: Always define rb_intern. (Ken Takata, closes #3275) --- src/if_ruby.c | 18 ++++++------------ src/version.c | 2 ++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index 63f7312503..450f34a0b7 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -253,12 +253,12 @@ static void ruby_vim_init(void); # define rb_hash_new dll_rb_hash_new # define rb_inspect dll_rb_inspect # define rb_int2inum dll_rb_int2inum -# ifndef rb_intern -# define rb_intern dll_rb_intern -# endif -# ifdef RUBY_CONST_ID_CACHE -# define rb_intern2 dll_rb_intern2 -# endif + +// ruby.h may redefine rb_intern to use RUBY_CONST_ID_CACHE(), but that won't +// work. Not using the cache appears to be the best solution. +# undef rb_intern +# define rb_intern dll_rb_intern + # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 18 # define rb_fix2int dll_rb_fix2int @@ -394,9 +394,6 @@ static VALUE (*dll_rb_hash_new) (void); static VALUE (*dll_rb_inspect) (VALUE); static VALUE (*dll_rb_int2inum) (long); static ID (*dll_rb_intern) (const char*); -# ifdef RUBY_CONST_ID_CACHE -static ID (*dll_rb_intern2) (const char*, long); -# endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ static long (*dll_rb_fix2int) (VALUE); static long (*dll_rb_num2int) (VALUE); @@ -597,9 +594,6 @@ static struct {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect}, {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum}, {"rb_intern", (RUBY_PROC*)&dll_rb_intern}, -# ifdef RUBY_CONST_ID_CACHE - {"rb_intern2", (RUBY_PROC*)&dll_rb_intern2}, -# endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int}, {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, diff --git a/src/version.c b/src/version.c index c5f1812566..bd8da20b4c 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 239, /**/ 238, /**/ From 3cb4448b8a5c0192988f4e349aba6d7a91a9a4bd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 5 Aug 2018 13:22:26 +0200 Subject: [PATCH 5/5] patch 8.1.0240: g:actual_curbuf set in wrong scope Problem: g:actual_curbuf set in wrong scope. (Daniel Hahler) Solution: Prepend the "g:" name space. (closes #3279) --- src/buffer.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index f76d849a2f..64ba5ab0e6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4229,7 +4229,7 @@ build_stl_str_hl( #ifdef FEAT_EVAL vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum); - set_internal_string_var((char_u *)"actual_curbuf", tmp); + set_internal_string_var((char_u *)"g:actual_curbuf", tmp); save_curbuf = curbuf; save_curwin = curwin; diff --git a/src/version.c b/src/version.c index bd8da20b4c..c3b7add519 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 240, /**/ 239, /**/