]> granicus.if.org Git - vim/commitdiff
patch 8.1.0209: stderr output from Ruby messes up display v8.1.0209
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Jul 2018 03:41:30 +0000 (05:41 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Jul 2018 03:41:30 +0000 (05:41 +0200)
Problem:    Stderr output from Ruby messes up display.
Solution:   Turn the stderr output into a Vim message. (Masataka Pocke
            Kuwabara, closes #3238)

src/if_ruby.c
src/version.c

index eb79077bdaf7c434998905bcf7a2d16d0a130322..d67801dfa53e7cf1c2e8f9b8bb891b85947622a0 100644 (file)
@@ -232,6 +232,7 @@ static void ruby_vim_init(void);
 # define rb_define_singleton_method    dll_rb_define_singleton_method
 # define rb_define_virtual_variable    dll_rb_define_virtual_variable
 # define rb_stdout                     (*dll_rb_stdout)
+# define rb_stderr                     (*dll_rb_stderr)
 # define rb_eArgError                  (*dll_rb_eArgError)
 # define rb_eIndexError                        (*dll_rb_eIndexError)
 # define rb_eRuntimeError              (*dll_rb_eRuntimeError)
@@ -360,6 +361,7 @@ static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int);
 static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int);
 static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)());
 static VALUE *dll_rb_stdout;
+static VALUE *dll_rb_stderr;
 static VALUE *dll_rb_eArgError;
 static VALUE *dll_rb_eIndexError;
 static VALUE *dll_rb_eRuntimeError;
@@ -553,6 +555,7 @@ static struct
     {"rb_define_singleton_method", (RUBY_PROC*)&dll_rb_define_singleton_method},
     {"rb_define_virtual_variable", (RUBY_PROC*)&dll_rb_define_virtual_variable},
     {"rb_stdout", (RUBY_PROC*)&dll_rb_stdout},
+    {"rb_stderr", (RUBY_PROC*)&dll_rb_stderr},
     {"rb_eArgError", (RUBY_PROC*)&dll_rb_eArgError},
     {"rb_eIndexError", (RUBY_PROC*)&dll_rb_eIndexError},
     {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError},
@@ -1542,11 +1545,15 @@ static void ruby_io_init(void)
 {
 #ifndef DYNAMIC_RUBY
     RUBYEXTERN VALUE rb_stdout;
+    RUBYEXTERN VALUE rb_stderr;
 #endif
 
     rb_stdout = rb_obj_alloc(rb_cObject);
+    rb_stderr = rb_obj_alloc(rb_cObject);
     rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
     rb_define_singleton_method(rb_stdout, "flush", f_nop, 0);
+    rb_define_singleton_method(rb_stderr, "write", vim_message, 1);
+    rb_define_singleton_method(rb_stderr, "flush", f_nop, 0);
     rb_define_global_function("p", f_p, -1);
 }
 
index e345fed5558552f9e123595668dce7292ea20b07..2db4044c3cc74d62e5baaa3484ad8f37f7dec804 100644 (file)
@@ -793,6 +793,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    209,
 /**/
     208,
 /**/