Skip to content

Commit 758535a

Browse files
committed
patch 7.4.1689
Problem: Ruby interface has inconsistent coding style. Solution: Fix the coding style. (Ken Takata)
1 parent 67c2c05 commit 758535a

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

src/if_ruby.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ vim_str2rb_enc_str(const char *s)
731731
{
732732
enc = rb_enc_find((char *)sval);
733733
vim_free(sval);
734-
if (enc) {
734+
if (enc)
735+
{
735736
return rb_enc_str_new(s, strlen(s), enc);
736737
}
737738
}
@@ -773,19 +774,23 @@ void ex_rubydo(exarg_T *eap)
773774
{
774775
if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
775776
return;
776-
for (i = eap->line1; i <= eap->line2; i++) {
777+
for (i = eap->line1; i <= eap->line2; i++)
778+
{
777779
VALUE line;
778780

779781
line = vim_str2rb_enc_str((char *)ml_get(i));
780782
rb_lastline_set(line);
781783
eval_enc_string_protect((char *) eap->arg, &state);
782-
if (state) {
784+
if (state)
785+
{
783786
error_print(state);
784787
break;
785788
}
786789
line = rb_lastline_get();
787-
if (!NIL_P(line)) {
788-
if (TYPE(line) != T_STRING) {
790+
if (!NIL_P(line))
791+
{
792+
if (TYPE(line) != T_STRING)
793+
{
789794
EMSG(_("E265: $_ must be an instance of String"));
790795
return;
791796
}
@@ -898,7 +903,8 @@ static void error_print(int state)
898903
#define TAG_FATAL 0x8
899904
#define TAG_MASK 0xf
900905

901-
switch (state) {
906+
switch (state)
907+
{
902908
case TAG_RETURN:
903909
EMSG(_("E267: unexpected return"));
904910
break;
@@ -923,10 +929,12 @@ static void error_print(int state)
923929
eclass = CLASS_OF(ruby_errinfo);
924930
einfo = rb_obj_as_string(ruby_errinfo);
925931
#endif
926-
if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) {
932+
if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0)
933+
{
927934
EMSG(_("E272: unhandled exception"));
928935
}
929-
else {
936+
else
937+
{
930938
VALUE epath;
931939
char *p;
932940

@@ -1208,7 +1216,8 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
12081216
/* set curwin/curbuf for "buf" and save some things */
12091217
aucmd_prepbuf(&aco, buf);
12101218

1211-
if (u_savesub(n) == OK) {
1219+
if (u_savesub(n) == OK)
1220+
{
12121221
ml_replace(n, (char_u *)line, TRUE);
12131222
changed();
12141223
#ifdef SYNTAX_HL
@@ -1249,7 +1258,8 @@ static VALUE buffer_delete(VALUE self, VALUE num)
12491258
/* set curwin/curbuf for "buf" and save some things */
12501259
aucmd_prepbuf(&aco, buf);
12511260

1252-
if (u_savedel(n, 1) == OK) {
1261+
if (u_savedel(n, 1) == OK)
1262+
{
12531263
ml_delete(n, 0);
12541264

12551265
/* Changes to non-active buffers should properly refresh
@@ -1288,7 +1298,8 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
12881298
/* set curwin/curbuf for "buf" and save some things */
12891299
aucmd_prepbuf(&aco, buf);
12901300

1291-
if (u_inssub(n + 1) == OK) {
1301+
if (u_inssub(n + 1) == OK)
1302+
{
12921303
ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
12931304

12941305
/* Changes to non-active buffers should properly refresh screen
@@ -1494,7 +1505,8 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
14941505
int i;
14951506
VALUE str = rb_str_new("", 0);
14961507

1497-
for (i = 0; i < argc; i++) {
1508+
for (i = 0; i < argc; i++)
1509+
{
14981510
if (i > 0) rb_str_cat(str, ", ", 2);
14991511
rb_str_concat(str, rb_inspect(argv[i]));
15001512
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1689,
751753
/**/
752754
1688,
753755
/**/

0 commit comments

Comments
 (0)