[ruby/reline] Remove unnecessary condition

07e911ec8e
This commit is contained in:
aycabta 2021-08-27 01:50:49 +09:00
parent fdc005e54e
commit 8e463e3e73

View file

@ -189,13 +189,12 @@ module Reline
end end
pre, target, post= retrieve_completion_block(true) pre, target, post= retrieve_completion_block(true)
if target.nil? or target.empty? if target.nil? or target.empty?
result = nil return nil
else end
result = call_completion_proc_with_checking_args(pre, target, post) result = call_completion_proc_with_checking_args(pre, target, post)
if result and result.size == 1 and result[0] == target if result and result.size == 1 and result[0] == target
result = nil result = nil
end end
end
target_width = Reline::Unicode.calculate_width(target) target_width = Reline::Unicode.calculate_width(target)
x = cursor_pos.x - target_width x = cursor_pos.x - target_width
if x < 0 if x < 0