diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2011-04-25 13:37:00 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:45:18 +0200 |
commit | 75a4a592e5ccda30715f93563d741b83e0dcf39e (patch) | |
tree | 502f745607e77a2c4386ad38d818ddcafe81489c /source/ap/vim/patches/7.2.374 | |
parent | b76270bf9e6dd375e495fec92140a79a79415d27 (diff) | |
download | current-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.gz |
Slackware 13.37slackware-13.37
Mon Apr 25 13:37:00 UTC 2011
Slackware 13.37 x86_64 stable is released!
Thanks to everyone who pitched in on this release: the Slackware team,
the folks producing upstream code, and linuxquestions.org for providing
a great forum for collaboration and testing.
The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware
project by picking up a copy from store.slackware.com. We're taking
pre-orders now, and offer a discount if you sign up for a subscription.
As always, thanks to the Slackware community for testing, suggestions,
and feedback. :-)
Have fun!
Diffstat (limited to 'source/ap/vim/patches/7.2.374')
-rw-r--r-- | source/ap/vim/patches/7.2.374 | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/source/ap/vim/patches/7.2.374 b/source/ap/vim/patches/7.2.374 deleted file mode 100644 index 50d3e74d..00000000 --- a/source/ap/vim/patches/7.2.374 +++ /dev/null @@ -1,168 +0,0 @@ -To: vim-dev@vim.org -Subject: Patch 7.2.374 -Fcc: outbox -From: Bram Moolenaar <Bram@moolenaar.net> -Mime-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit ------------- - -Patch 7.2.374 -Problem: Ruby eval() doesn't understand Vim types. -Solution: Add the vim_to_ruby() function. (George Gensure) -Files: src/eval.c, src/if_ruby.c - - -*** ../vim-7.2.373/src/eval.c 2010-01-19 15:51:29.000000000 +0100 ---- src/eval.c 2010-02-24 15:36:40.000000000 +0100 -*************** -*** 5872,5878 **** - return item1 == NULL && item2 == NULL; - } - -! #if defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) || defined(PROTO) - /* - * Return the dictitem that an entry in a hashtable points to. - */ ---- 5872,5879 ---- - return item1 == NULL && item2 == NULL; - } - -! #if defined(FEAT_RUBY) || defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) \ -! || defined(PROTO) - /* - * Return the dictitem that an entry in a hashtable points to. - */ -*** ../vim-7.2.373/src/if_ruby.c 2010-02-18 15:51:25.000000000 +0100 ---- src/if_ruby.c 2010-02-24 15:45:15.000000000 +0100 -*************** -*** 660,679 **** - return Qnil; - } - - static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) - { - #ifdef FEAT_EVAL -! char_u *value = eval_to_string((char_u *)StringValuePtr(str), NULL, TRUE); - -! if (value != NULL) - { -! VALUE val = rb_str_new2((char *)value); -! vim_free(value); -! return val; - } -! else - #endif -- return Qnil; - } - - static VALUE buffer_new(buf_T *buf) ---- 660,747 ---- - return Qnil; - } - -+ #ifdef FEAT_EVAL -+ static VALUE vim_to_ruby(typval_T *tv) -+ { -+ VALUE result = Qnil; -+ -+ if (tv->v_type == VAR_STRING) -+ { -+ result = rb_str_new2((char *)tv->vval.v_string); -+ } -+ else if (tv->v_type == VAR_NUMBER) -+ { -+ result = INT2NUM(tv->vval.v_number); -+ } -+ # ifdef FEAT_FLOAT -+ else if (tv->v_type == VAR_FLOAT) -+ { -+ result = rb_float_new(tv->vval.v_float); -+ } -+ # endif -+ else if (tv->v_type == VAR_LIST) -+ { -+ list_T *list = tv->vval.v_list; -+ listitem_T *curr; -+ -+ result = rb_ary_new(); -+ -+ if (list != NULL) -+ { -+ for (curr = list->lv_first; curr != NULL; curr = curr->li_next) -+ { -+ rb_ary_push(result, vim_to_ruby(&curr->li_tv)); -+ } -+ } -+ } -+ else if (tv->v_type == VAR_DICT) -+ { -+ result = rb_hash_new(); -+ -+ if (tv->vval.v_dict != NULL) -+ { -+ hashtab_T *ht = &tv->vval.v_dict->dv_hashtab; -+ long_u todo = ht->ht_used; -+ hashitem_T *hi; -+ dictitem_T *di; -+ -+ for (hi = ht->ht_array; todo > 0; ++hi) -+ { -+ if (!HASHITEM_EMPTY(hi)) -+ { -+ --todo; -+ -+ di = dict_lookup(hi); -+ rb_hash_aset(result, rb_str_new2((char *)hi->hi_key), -+ vim_to_ruby(&di->di_tv)); -+ } -+ } -+ } -+ } /* else return Qnil; */ -+ -+ return result; -+ } -+ #endif -+ - static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) - { - #ifdef FEAT_EVAL -! typval_T *tv; -! VALUE result; - -! tv = eval_expr((char_u *)StringValuePtr(str), NULL); -! if (tv == NULL) - { -! return Qnil; - } -! result = vim_to_ruby(tv); -! -! free_tv(tv); -! -! return result; -! #else -! return Qnil; - #endif - } - - static VALUE buffer_new(buf_T *buf) -*** ../vim-7.2.373/src/version.c 2010-02-24 15:25:13.000000000 +0100 ---- src/version.c 2010-02-24 15:46:57.000000000 +0100 -*************** -*** 683,684 **** ---- 683,686 ---- - { /* Add new patch number below this line */ -+ /**/ -+ 374, - /**/ - --- -ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away! - Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd - cow or goose hitting them still. The KNIGHTS crouch down under cover. - "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD - - /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ -/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ -\\\ download, build and distribute -- http://www.A-A-P.org /// - \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |