Skip to content

Commit ee752ce

Browse files
authored
[DOC] Add documentation for IO#cursor
#50
1 parent aa9e791 commit ee752ce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/io/console/console.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,16 @@ console_scroll(VALUE io, int line)
11521152
# define console_key_pressed_p rb_f_notimplement
11531153
#endif
11541154

1155+
/*
1156+
* call-seq:
1157+
* io.cursor -> [row, column]
1158+
*
1159+
* Returns the current cursor position as a two-element array of integers (row, column)
1160+
*
1161+
* io.cursor # => [3, 5]
1162+
*
1163+
* You must require 'io/console' to use this method.
1164+
*/
11551165
static VALUE
11561166
console_cursor_pos(VALUE io)
11571167
{

0 commit comments

Comments
 (0)