@@ -831,7 +831,7 @@ mode_in_range(VALUE val, int high, const char *modename)
831
831
832
832
#if defined _WIN32
833
833
static VALUE
834
- console_goto (VALUE io , VALUE x , VALUE y )
834
+ console_goto (VALUE io , VALUE y , VALUE x )
835
835
{
836
836
rb_io_t * fptr ;
837
837
int fd ;
@@ -859,11 +859,11 @@ console_cursor_pos(VALUE io)
859
859
if (!GetConsoleScreenBufferInfo ((HANDLE )rb_w32_get_osfhandle (fd ), & ws )) {
860
860
rb_syserr_fail (LAST_ERROR , 0 );
861
861
}
862
- return rb_assoc_new (UINT2NUM (ws .dwCursorPosition .X ), UINT2NUM (ws .dwCursorPosition .Y ));
862
+ return rb_assoc_new (UINT2NUM (ws .dwCursorPosition .Y ), UINT2NUM (ws .dwCursorPosition .X ));
863
863
}
864
864
865
865
static VALUE
866
- console_move (VALUE io , int x , int y )
866
+ console_move (VALUE io , int y , int x )
867
867
{
868
868
rb_io_t * fptr ;
869
869
HANDLE h ;
@@ -1116,20 +1116,18 @@ console_cursor_pos(VALUE io)
1116
1116
row = RARRAY_AREF (resp , 0 );
1117
1117
column = RARRAY_AREF (resp , 1 );
1118
1118
rb_ary_resize (resp , 2 );
1119
- RARRAY_ASET (resp , 0 , column );
1120
- RARRAY_ASET (resp , 1 , row );
1121
1119
return resp ;
1122
1120
}
1123
1121
1124
1122
static VALUE
1125
- console_goto (VALUE io , VALUE x , VALUE y )
1123
+ console_goto (VALUE io , VALUE y , VALUE x )
1126
1124
{
1127
1125
rb_io_write (io , rb_sprintf ("\x1b[%d;%dH" , NUM2UINT (y ), NUM2UINT (x )));
1128
1126
return io ;
1129
1127
}
1130
1128
1131
1129
static VALUE
1132
- console_move (VALUE io , int x , int y )
1130
+ console_move (VALUE io , int y , int x )
1133
1131
{
1134
1132
if (x || y ) {
1135
1133
VALUE s = rb_str_new_cstr ("" );
@@ -1188,25 +1186,25 @@ console_cursor_set(VALUE io, VALUE cpos)
1188
1186
static VALUE
1189
1187
console_cursor_up (VALUE io , VALUE val )
1190
1188
{
1191
- return console_move (io , 0 , - NUM2INT (val ));
1189
+ return console_move (io , - NUM2INT (val ), 0 );
1192
1190
}
1193
1191
1194
1192
static VALUE
1195
1193
console_cursor_down (VALUE io , VALUE val )
1196
1194
{
1197
- return console_move (io , 0 , + NUM2INT (val ));
1195
+ return console_move (io , + NUM2INT (val ), 0 );
1198
1196
}
1199
1197
1200
1198
static VALUE
1201
1199
console_cursor_left (VALUE io , VALUE val )
1202
1200
{
1203
- return console_move (io , - NUM2INT (val ), 0 );
1201
+ return console_move (io , 0 , - NUM2INT (val ));
1204
1202
}
1205
1203
1206
1204
static VALUE
1207
1205
console_cursor_right (VALUE io , VALUE val )
1208
1206
{
1209
- return console_move (io , + NUM2INT (val ), 0 );
1207
+ return console_move (io , 0 , + NUM2INT (val ));
1210
1208
}
1211
1209
1212
1210
static VALUE
0 commit comments