@@ -731,7 +731,8 @@ vim_str2rb_enc_str(const char *s)
731
731
{
732
732
enc = rb_enc_find ((char * )sval );
733
733
vim_free (sval );
734
- if (enc ) {
734
+ if (enc )
735
+ {
735
736
return rb_enc_str_new (s , strlen (s ), enc );
736
737
}
737
738
}
@@ -773,19 +774,23 @@ void ex_rubydo(exarg_T *eap)
773
774
{
774
775
if (u_save (eap -> line1 - 1 , eap -> line2 + 1 ) != OK )
775
776
return ;
776
- for (i = eap -> line1 ; i <= eap -> line2 ; i ++ ) {
777
+ for (i = eap -> line1 ; i <= eap -> line2 ; i ++ )
778
+ {
777
779
VALUE line ;
778
780
779
781
line = vim_str2rb_enc_str ((char * )ml_get (i ));
780
782
rb_lastline_set (line );
781
783
eval_enc_string_protect ((char * ) eap -> arg , & state );
782
- if (state ) {
784
+ if (state )
785
+ {
783
786
error_print (state );
784
787
break ;
785
788
}
786
789
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
+ {
789
794
EMSG (_ ("E265: $_ must be an instance of String" ));
790
795
return ;
791
796
}
@@ -898,7 +903,8 @@ static void error_print(int state)
898
903
#define TAG_FATAL 0x8
899
904
#define TAG_MASK 0xf
900
905
901
- switch (state ) {
906
+ switch (state )
907
+ {
902
908
case TAG_RETURN :
903
909
EMSG (_ ("E267: unexpected return" ));
904
910
break ;
@@ -923,10 +929,12 @@ static void error_print(int state)
923
929
eclass = CLASS_OF (ruby_errinfo );
924
930
einfo = rb_obj_as_string (ruby_errinfo );
925
931
#endif
926
- if (eclass == rb_eRuntimeError && RSTRING_LEN (einfo ) == 0 ) {
932
+ if (eclass == rb_eRuntimeError && RSTRING_LEN (einfo ) == 0 )
933
+ {
927
934
EMSG (_ ("E272: unhandled exception" ));
928
935
}
929
- else {
936
+ else
937
+ {
930
938
VALUE epath ;
931
939
char * p ;
932
940
@@ -1208,7 +1216,8 @@ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
1208
1216
/* set curwin/curbuf for "buf" and save some things */
1209
1217
aucmd_prepbuf (& aco , buf );
1210
1218
1211
- if (u_savesub (n ) == OK ) {
1219
+ if (u_savesub (n ) == OK )
1220
+ {
1212
1221
ml_replace (n , (char_u * )line , TRUE);
1213
1222
changed ();
1214
1223
#ifdef SYNTAX_HL
@@ -1249,7 +1258,8 @@ static VALUE buffer_delete(VALUE self, VALUE num)
1249
1258
/* set curwin/curbuf for "buf" and save some things */
1250
1259
aucmd_prepbuf (& aco , buf );
1251
1260
1252
- if (u_savedel (n , 1 ) == OK ) {
1261
+ if (u_savedel (n , 1 ) == OK )
1262
+ {
1253
1263
ml_delete (n , 0 );
1254
1264
1255
1265
/* Changes to non-active buffers should properly refresh
@@ -1288,7 +1298,8 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
1288
1298
/* set curwin/curbuf for "buf" and save some things */
1289
1299
aucmd_prepbuf (& aco , buf );
1290
1300
1291
- if (u_inssub (n + 1 ) == OK ) {
1301
+ if (u_inssub (n + 1 ) == OK )
1302
+ {
1292
1303
ml_append (n , (char_u * ) line , (colnr_T ) 0 , FALSE);
1293
1304
1294
1305
/* Changes to non-active buffers should properly refresh screen
@@ -1494,7 +1505,8 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
1494
1505
int i ;
1495
1506
VALUE str = rb_str_new ("" , 0 );
1496
1507
1497
- for (i = 0 ; i < argc ; i ++ ) {
1508
+ for (i = 0 ; i < argc ; i ++ )
1509
+ {
1498
1510
if (i > 0 ) rb_str_cat (str , ", " , 2 );
1499
1511
rb_str_concat (str , rb_inspect (argv [i ]));
1500
1512
}
0 commit comments