diff --git a/src/auto/configure b/src/auto/configure index 5b9055439b..91f774dd4e 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -7690,6 +7690,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/buffer.c b/src/buffer.c index 7426d5f12c..88ed7261a0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4239,7 +4239,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/configure.ac b/src/configure.ac index ed2feb8f64..9d4b0d2190 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -2020,6 +2020,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/if_ruby.c b/src/if_ruby.c index bf83c8b965..450f34a0b7 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 -# define rb_intern dll_rb_intern -# 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 @@ -392,11 +393,7 @@ 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*); -# endif # if VIM_SIZEOF_INT < VIM_SIZEOF_LONG /* 64 bits only */ static long (*dll_rb_fix2int) (VALUE); static long (*dll_rb_num2int) (VALUE); @@ -596,11 +593,7 @@ 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}, -# 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/terminal.c b/src/terminal.c index 6392072f6d..fc8d314a12 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 1c54075d5f..c46623805a 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -1615,3 +1615,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 4176085031..bbae044866 100644 --- a/src/version.c +++ b/src/version.c @@ -809,6 +809,16 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 240, +/**/ + 239, +/**/ + 238, +/**/ + 237, +/**/ + 236, /**/ 235, /**/