To: vim_dev@googlegroups.com Subject: Patch 7.4.1689 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1689 Problem: Ruby interface has inconsistent coding style. Solution: Fix the coding style. (Ken Takata) Files: src/if_ruby.c *** ../vim-7.4.1688/src/if_ruby.c 2016-03-19 22:11:47.424674965 +0100 --- src/if_ruby.c 2016-03-30 22:04:44.528224197 +0200 *************** *** 731,737 **** { enc = rb_enc_find((char *)sval); vim_free(sval); ! if (enc) { return rb_enc_str_new(s, strlen(s), enc); } } --- 731,738 ---- { enc = rb_enc_find((char *)sval); vim_free(sval); ! if (enc) ! { return rb_enc_str_new(s, strlen(s), enc); } } *************** *** 773,791 **** { if (u_save(eap->line1 - 1, eap->line2 + 1) != OK) return; ! for (i = eap->line1; i <= eap->line2; i++) { VALUE line; line = vim_str2rb_enc_str((char *)ml_get(i)); rb_lastline_set(line); eval_enc_string_protect((char *) eap->arg, &state); ! if (state) { error_print(state); break; } line = rb_lastline_get(); ! if (!NIL_P(line)) { ! if (TYPE(line) != T_STRING) { EMSG(_("E265: $_ must be an instance of String")); return; } --- 774,796 ---- { if (u_save(eap->line1 - 1, eap->line2 + 1) != OK) return; ! for (i = eap->line1; i <= eap->line2; i++) ! { VALUE line; line = vim_str2rb_enc_str((char *)ml_get(i)); rb_lastline_set(line); eval_enc_string_protect((char *) eap->arg, &state); ! if (state) ! { error_print(state); break; } line = rb_lastline_get(); ! if (!NIL_P(line)) ! { ! if (TYPE(line) != T_STRING) ! { EMSG(_("E265: $_ must be an instance of String")); return; } *************** *** 898,904 **** #define TAG_FATAL 0x8 #define TAG_MASK 0xf ! switch (state) { case TAG_RETURN: EMSG(_("E267: unexpected return")); break; --- 903,910 ---- #define TAG_FATAL 0x8 #define TAG_MASK 0xf ! switch (state) ! { case TAG_RETURN: EMSG(_("E267: unexpected return")); break; *************** *** 923,932 **** eclass = CLASS_OF(ruby_errinfo); einfo = rb_obj_as_string(ruby_errinfo); #endif ! if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) { EMSG(_("E272: unhandled exception")); } ! else { VALUE epath; char *p; --- 929,940 ---- eclass = CLASS_OF(ruby_errinfo); einfo = rb_obj_as_string(ruby_errinfo); #endif ! if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) ! { EMSG(_("E272: unhandled exception")); } ! else ! { VALUE epath; char *p; *************** *** 1208,1214 **** /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_savesub(n) == OK) { ml_replace(n, (char_u *)line, TRUE); changed(); #ifdef SYNTAX_HL --- 1216,1223 ---- /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_savesub(n) == OK) ! { ml_replace(n, (char_u *)line, TRUE); changed(); #ifdef SYNTAX_HL *************** *** 1249,1255 **** /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_savedel(n, 1) == OK) { ml_delete(n, 0); /* Changes to non-active buffers should properly refresh --- 1258,1265 ---- /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_savedel(n, 1) == OK) ! { ml_delete(n, 0); /* Changes to non-active buffers should properly refresh *************** *** 1288,1294 **** /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_inssub(n + 1) == OK) { ml_append(n, (char_u *) line, (colnr_T) 0, FALSE); /* Changes to non-active buffers should properly refresh screen --- 1298,1305 ---- /* set curwin/curbuf for "buf" and save some things */ aucmd_prepbuf(&aco, buf); ! if (u_inssub(n + 1) == OK) ! { ml_append(n, (char_u *) line, (colnr_T) 0, FALSE); /* Changes to non-active buffers should properly refresh screen *************** *** 1494,1500 **** int i; VALUE str = rb_str_new("", 0); ! for (i = 0; i < argc; i++) { if (i > 0) rb_str_cat(str, ", ", 2); rb_str_concat(str, rb_inspect(argv[i])); } --- 1505,1512 ---- int i; VALUE str = rb_str_new("", 0); ! for (i = 0; i < argc; i++) ! { if (i > 0) rb_str_cat(str, ", ", 2); rb_str_concat(str, rb_inspect(argv[i])); } *** ../vim-7.4.1688/src/version.c 2016-03-30 22:02:58.649307729 +0200 --- src/version.c 2016-03-30 22:05:23.951820774 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1689, /**/ -- hundred-and-one symptoms of being an internet addict: 173. You keep tracking down the email addresses of all your friends (even childhood friends). /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///