comparison src/if_ruby.c @ 501:ce2181d14aa0 v7.0139

updated for version 7.0139
author vimboss
date Tue, 30 Aug 2005 21:55:26 +0000
parents ddada568db54
children 52e76e2b5b65
comparison
equal deleted inserted replaced
500:4772a5e3f9fa 501:ce2181d14aa0
189 #endif 189 #endif
190 190
191 static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */ 191 static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
192 192
193 /* 193 /*
194 * Table of name to function pointer of python. 194 * Table of name to function pointer of ruby.
195 */ 195 */
196 #define RUBY_PROC FARPROC 196 #define RUBY_PROC FARPROC
197 static struct 197 static struct
198 { 198 {
199 char *name; 199 char *name;
766 win_setheight(NUM2INT(height)); 766 win_setheight(NUM2INT(height));
767 curwin = savewin; 767 curwin = savewin;
768 return height; 768 return height;
769 } 769 }
770 770
771 static VALUE window_width(VALUE self)
772 {
773 win_T *win = get_win(self);
774
775 return INT2NUM(win->w_width);
776 }
777
778 static VALUE window_set_width(VALUE self, VALUE width)
779 {
780 win_T *win = get_win(self);
781 win_T *savewin = curwin;
782
783 curwin = win;
784 win_setwidth(NUM2INT(width));
785 curwin = savewin;
786 return width;
787 }
788
771 static VALUE window_cursor(VALUE self) 789 static VALUE window_cursor(VALUE self)
772 { 790 {
773 win_T *win = get_win(self); 791 win_T *win = get_win(self);
774 792
775 return rb_assoc_new(INT2NUM(win->w_cursor.lnum), INT2NUM(win->w_cursor.col)); 793 return rb_assoc_new(INT2NUM(win->w_cursor.lnum), INT2NUM(win->w_cursor.col));
858 rb_define_singleton_method(cVimWindow, "count", window_s_count, 0); 876 rb_define_singleton_method(cVimWindow, "count", window_s_count, 0);
859 rb_define_singleton_method(cVimWindow, "[]", window_s_aref, 1); 877 rb_define_singleton_method(cVimWindow, "[]", window_s_aref, 1);
860 rb_define_method(cVimWindow, "buffer", window_buffer, 0); 878 rb_define_method(cVimWindow, "buffer", window_buffer, 0);
861 rb_define_method(cVimWindow, "height", window_height, 0); 879 rb_define_method(cVimWindow, "height", window_height, 0);
862 rb_define_method(cVimWindow, "height=", window_set_height, 1); 880 rb_define_method(cVimWindow, "height=", window_set_height, 1);
881 rb_define_method(cVimWindow, "width", window_width, 0);
882 rb_define_method(cVimWindow, "width=", window_set_width, 1);
863 rb_define_method(cVimWindow, "cursor", window_cursor, 0); 883 rb_define_method(cVimWindow, "cursor", window_cursor, 0);
864 rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); 884 rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1);
865 885
866 rb_define_virtual_variable("$curbuf", buffer_s_current, 0); 886 rb_define_virtual_variable("$curbuf", buffer_s_current, 0);
867 rb_define_virtual_variable("$curwin", window_s_current, 0); 887 rb_define_virtual_variable("$curwin", window_s_current, 0);