Mercurial > vim
comparison src/if_ruby.c @ 3474:d7b335626ddc v7.3.501
updated for version 7.3.501
Problem: Error for "flush" not being defined when using Ruby command.
Solution: Defined "flush" as a no-op method. (Kent Sibilev)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 20 Apr 2012 18:05:47 +0200 |
parents | ad404f2a4bfa |
children | 65d036fd449e |
comparison
equal
deleted
inserted
replaced
3473:a0a87a0791fe | 3474:d7b335626ddc |
---|---|
1236 check_cursor(); /* put cursor on an existing line */ | 1236 check_cursor(); /* put cursor on an existing line */ |
1237 update_screen(NOT_VALID); | 1237 update_screen(NOT_VALID); |
1238 return Qnil; | 1238 return Qnil; |
1239 } | 1239 } |
1240 | 1240 |
1241 static VALUE f_nop(VALUE self) | |
1242 { | |
1243 return Qnil; | |
1244 } | |
1245 | |
1241 static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED) | 1246 static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED) |
1242 { | 1247 { |
1243 int i; | 1248 int i; |
1244 VALUE str = rb_str_new("", 0); | 1249 VALUE str = rb_str_new("", 0); |
1245 | 1250 |
1257 RUBYEXTERN VALUE rb_stdout; | 1262 RUBYEXTERN VALUE rb_stdout; |
1258 #endif | 1263 #endif |
1259 | 1264 |
1260 rb_stdout = rb_obj_alloc(rb_cObject); | 1265 rb_stdout = rb_obj_alloc(rb_cObject); |
1261 rb_define_singleton_method(rb_stdout, "write", vim_message, 1); | 1266 rb_define_singleton_method(rb_stdout, "write", vim_message, 1); |
1267 rb_define_singleton_method(rb_stdout, "flush", f_nop, 0); | |
1262 rb_define_global_function("p", f_p, -1); | 1268 rb_define_global_function("p", f_p, -1); |
1263 } | 1269 } |
1264 | 1270 |
1265 static void ruby_vim_init(void) | 1271 static void ruby_vim_init(void) |
1266 { | 1272 { |