File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ def readline(prompt = '', add_hist = false)
336
336
@ambiguous_width = 2 if Reline ::IOGate == Reline ::GeneralIO or STDOUT . is_a? ( File )
337
337
return if ambiguous_width
338
338
Reline ::IOGate . move_cursor_column ( 0 )
339
- print "\u{25bd} "
339
+ output . write "\u{25bd} "
340
340
@ambiguous_width = Reline ::IOGate . cursor_pos . x
341
341
Reline ::IOGate . move_cursor_column ( 0 )
342
342
Reline ::IOGate . erase_after_cursor
Original file line number Diff line number Diff line change @@ -124,37 +124,37 @@ def self.cursor_pos
124
124
end
125
125
126
126
def self . move_cursor_column ( x )
127
- print "\e [#{ x + 1 } G"
127
+ @@output . write "\e [#{ x + 1 } G"
128
128
end
129
129
130
130
def self . move_cursor_up ( x )
131
131
if x > 0
132
- print "\e [#{ x } A" if x > 0
132
+ @@output . write "\e [#{ x } A" if x > 0
133
133
elsif x < 0
134
134
move_cursor_down ( -x )
135
135
end
136
136
end
137
137
138
138
def self . move_cursor_down ( x )
139
139
if x > 0
140
- print "\e [#{ x } B" if x > 0
140
+ @@output . write "\e [#{ x } B" if x > 0
141
141
elsif x < 0
142
142
move_cursor_up ( -x )
143
143
end
144
144
end
145
145
146
146
def self . erase_after_cursor
147
- print "\e [K"
147
+ @@output . write "\e [K"
148
148
end
149
149
150
150
def self . scroll_down ( x )
151
151
return if x . zero?
152
- print "\e [#{ x } S"
152
+ @@output . write "\e [#{ x } S"
153
153
end
154
154
155
155
def self . clear_screen
156
- print "\e [2J"
157
- print "\e [1;1H"
156
+ @@output . write "\e [2J"
157
+ @@output . write "\e [1;1H"
158
158
end
159
159
160
160
@@old_winch_handler = nil
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ def rerender
319
319
@rerender_all = true
320
320
@menu_info . list . sort! . each do |item |
321
321
Reline ::IOGate . move_cursor_column ( 0 )
322
- @output . print item
322
+ @output . write item
323
323
@output . flush
324
324
scroll_down ( 1 )
325
325
end
@@ -516,7 +516,7 @@ def rerender
516
516
end
517
517
next
518
518
end
519
- @output . print line
519
+ @output . write line
520
520
if Reline ::IOGate . win? and calculate_width ( line , true ) == Reline ::IOGate . get_screen_size . last
521
521
# A newline is automatically inserted if a character is rendered at eol on command prompt.
522
522
@rest_height -= 1 if @rest_height > 0
Original file line number Diff line number Diff line change @@ -250,8 +250,8 @@ def self.scroll_down(val)
250
250
251
251
def self . clear_screen
252
252
# TODO: Use FillConsoleOutputCharacter and FillConsoleOutputAttribute
253
- print "\e [2J"
254
- print "\e [1;1H"
253
+ write "\e [2J"
254
+ write "\e [1;1H"
255
255
end
256
256
257
257
def self . set_screen_size ( rows , columns )
You can’t perform that action at this time.
0 commit comments