summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-08-30 21:55:26 +0000
committerBram Moolenaar <Bram@vim.org>2005-08-30 21:55:26 +0000
commitda2303d96b0f55d30e9b5b57d3459d5e1ea22ec2 (patch)
tree08f61aa2e9937f30bd141fd6509bc947e1d8a8fa /src/if_ruby.c
parentac6e65f88da446bc764ff13a23d854fd72ffedcf (diff)
downloadvim-git-da2303d96b0f55d30e9b5b57d3459d5e1ea22ec2.tar.gz
updated for version 7.0139v7.0139
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 112b91e5d..4396b467d 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -191,7 +191,7 @@ static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
/*
- * Table of name to function pointer of python.
+ * Table of name to function pointer of ruby.
*/
#define RUBY_PROC FARPROC
static struct
@@ -768,6 +768,24 @@ static VALUE window_set_height(VALUE self, VALUE height)
return height;
}
+static VALUE window_width(VALUE self)
+{
+ win_T *win = get_win(self);
+
+ return INT2NUM(win->w_width);
+}
+
+static VALUE window_set_width(VALUE self, VALUE width)
+{
+ win_T *win = get_win(self);
+ win_T *savewin = curwin;
+
+ curwin = win;
+ win_setwidth(NUM2INT(width));
+ curwin = savewin;
+ return width;
+}
+
static VALUE window_cursor(VALUE self)
{
win_T *win = get_win(self);
@@ -860,6 +878,8 @@ static void ruby_vim_init(void)
rb_define_method(cVimWindow, "buffer", window_buffer, 0);
rb_define_method(cVimWindow, "height", window_height, 0);
rb_define_method(cVimWindow, "height=", window_set_height, 1);
+ rb_define_method(cVimWindow, "width", window_width, 0);
+ rb_define_method(cVimWindow, "width=", window_set_width, 1);
rb_define_method(cVimWindow, "cursor", window_cursor, 0);
rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1);