summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-08-31 19:36:26 +0900
committeraycabta <aycabta@gmail.com>2021-08-31 20:35:10 +0900
commit64373a3c58820fd7b3313f43de2a58d8516a1c95 (patch)
tree16ce506231a0717c7bc74cb0fd32c49b908e8d3a /lib
parenta75f38431e7573b7cfd720816f51082fcc40d609 (diff)
Move access to dialog_render_info inside nil check
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 382f638d25..d254738be2 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -589,9 +589,9 @@ class Reline::LineEditor
end
dialog.set_cursor_pos(cursor_column, @first_line_started_from + @started_from)
dialog_render_info = dialog.call
- dialog.width = dialog_render_info.width if dialog_render_info and dialog_render_info.width
old_dialog = dialog.clone
if dialog_render_info and dialog_render_info.contents and not dialog_render_info.contents.empty?
+ dialog.width = dialog_render_info.width if dialog_render_info.width
height = dialog_render_info.height || DIALOG_HEIGHT
pointer = dialog_render_info.pointer
dialog.contents = dialog_render_info.contents