@@ -153,7 +153,7 @@ def resize
153
153
scroll_into_view
154
154
Reline ::IOGate . move_cursor_up @rendered_screen . cursor_y
155
155
@rendered_screen . base_y = Reline ::IOGate . cursor_pos . y
156
- @rendered_screen . lines = nil
156
+ @rendered_screen . lines = [ ]
157
157
@rendered_screen . cursor_y = 0
158
158
render_differential
159
159
end
@@ -164,7 +164,7 @@ def set_signal_handlers
164
164
scrolldown = render_differential
165
165
Reline ::IOGate . scroll_down scrolldown
166
166
Reline ::IOGate . move_cursor_column 0
167
- @rendered_screen . lines = nil
167
+ @rendered_screen . lines = [ ]
168
168
@rendered_screen . cursor_y = 0
169
169
case @old_trap
170
170
when 'DEFAULT' , 'SYSTEM_DEFAULT'
@@ -217,7 +217,7 @@ def reset_variables(prompt = '', encoding:)
217
217
@dialogs = [ ]
218
218
@resized = false
219
219
@cache = { }
220
- @rendered_screen = RenderedScreen . new ( base_y : 0 , lines : nil , cursor_y : 0 )
220
+ @rendered_screen = RenderedScreen . new ( base_y : 0 , lines : [ ] , cursor_y : 0 )
221
221
reset_line
222
222
end
223
223
@@ -421,7 +421,7 @@ def clear_rendered_lines
421
421
Reline ::IOGate . move_cursor_up @rendered_screen . cursor_y
422
422
Reline ::IOGate . move_cursor_column 0
423
423
424
- num_lines = @rendered_screen . lines & .size
424
+ num_lines = @rendered_screen . lines . size
425
425
return unless num_lines && num_lines >= 1
426
426
427
427
Reline ::IOGate . move_cursor_down num_lines - 1
@@ -430,7 +430,7 @@ def clear_rendered_lines
430
430
Reline ::IOGate . move_cursor_up 1
431
431
end
432
432
Reline ::IOGate . erase_after_cursor
433
- @rendered_screen . lines = nil
433
+ @rendered_screen . lines = [ ]
434
434
@rendered_screen . cursor_y = 0
435
435
end
436
436
@@ -455,7 +455,7 @@ def print_nomultiline_prompt(prompt)
455
455
def render_differential
456
456
wrapped_cursor_x , wrapped_cursor_y = wrapped_cursor_position
457
457
458
- rendered_lines = @rendered_screen . lines || [ ]
458
+ rendered_lines = @rendered_screen . lines
459
459
new_lines = wrapped_lines . flatten [ screen_scroll_top , screen_height ] . map do |l |
460
460
[ [ 0 , Reline ::Unicode . calculate_width ( l , true ) , l ] ]
461
461
end
@@ -528,7 +528,7 @@ def handle_cleared
528
528
@cleared = false
529
529
Reline ::IOGate . clear_screen
530
530
@screen_size = Reline ::IOGate . get_screen_size
531
- @rendered_screen . lines = nil
531
+ @rendered_screen . lines = [ ]
532
532
@rendered_screen . base_y = 0
533
533
@rendered_screen . cursor_y = 0
534
534
end
0 commit comments