Skip to content

Commit b6c8cd8

Browse files
committed
patch 8.1.0209: stderr output from Ruby messes up display
Problem: Stderr output from Ruby messes up display. Solution: Turn the stderr output into a Vim message. (Masataka Pocke Kuwabara, closes #3238)
1 parent 7624af0 commit b6c8cd8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/if_ruby.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static void ruby_vim_init(void);
232232
# define rb_define_singleton_method dll_rb_define_singleton_method
233233
# define rb_define_virtual_variable dll_rb_define_virtual_variable
234234
# define rb_stdout (*dll_rb_stdout)
235+
# define rb_stderr (*dll_rb_stderr)
235236
# define rb_eArgError (*dll_rb_eArgError)
236237
# define rb_eIndexError (*dll_rb_eIndexError)
237238
# define rb_eRuntimeError (*dll_rb_eRuntimeError)
@@ -360,6 +361,7 @@ static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int);
360361
static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int);
361362
static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)());
362363
static VALUE *dll_rb_stdout;
364+
static VALUE *dll_rb_stderr;
363365
static VALUE *dll_rb_eArgError;
364366
static VALUE *dll_rb_eIndexError;
365367
static VALUE *dll_rb_eRuntimeError;
@@ -553,6 +555,7 @@ static struct
553555
{"rb_define_singleton_method", (RUBY_PROC*)&dll_rb_define_singleton_method},
554556
{"rb_define_virtual_variable", (RUBY_PROC*)&dll_rb_define_virtual_variable},
555557
{"rb_stdout", (RUBY_PROC*)&dll_rb_stdout},
558+
{"rb_stderr", (RUBY_PROC*)&dll_rb_stderr},
556559
{"rb_eArgError", (RUBY_PROC*)&dll_rb_eArgError},
557560
{"rb_eIndexError", (RUBY_PROC*)&dll_rb_eIndexError},
558561
{"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError},
@@ -1542,11 +1545,15 @@ static void ruby_io_init(void)
15421545
{
15431546
#ifndef DYNAMIC_RUBY
15441547
RUBYEXTERN VALUE rb_stdout;
1548+
RUBYEXTERN VALUE rb_stderr;
15451549
#endif
15461550

15471551
rb_stdout = rb_obj_alloc(rb_cObject);
1552+
rb_stderr = rb_obj_alloc(rb_cObject);
15481553
rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
15491554
rb_define_singleton_method(rb_stdout, "flush", f_nop, 0);
1555+
rb_define_singleton_method(rb_stderr, "write", vim_message, 1);
1556+
rb_define_singleton_method(rb_stderr, "flush", f_nop, 0);
15501557
rb_define_global_function("p", f_p, -1);
15511558
}
15521559

src/version.c

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

794794
static int included_patches[] =
795795
{ /* Add new patch number below this line */
796+
/**/
797+
209,
796798
/**/
797799
208,
798800
/**/

0 commit comments

Comments
 (0)