summaryrefslogtreecommitdiff
path: root/lib/reline.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-08-27 01:50:49 +0900
committeraycabta <aycabta@gmail.com>2021-08-29 20:30:33 +0900
commit8e463e3e73e37ff57a5fde142436280846718ecf (patch)
treeb9dedb63d691eaae7a8a12c5e390378172271728 /lib/reline.rb
parentfdc005e54e58bbf005381bcfc7ac59d56fb05aac (diff)
[ruby/reline] Remove unnecessary condition
https://github.com/ruby/reline/commit/07e911ec8e
Diffstat (limited to 'lib/reline.rb')
-rw-r--r--lib/reline.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index 91648bf447..a3f37d1ab0 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -189,12 +189,11 @@ module Reline
end
pre, target, post= retrieve_completion_block(true)
if target.nil? or target.empty?
+ return nil
+ end
+ result = call_completion_proc_with_checking_args(pre, target, post)
+ if result and result.size == 1 and result[0] == target
result = nil
- else
- result = call_completion_proc_with_checking_args(pre, target, post)
- if result and result.size == 1 and result[0] == target
- result = nil
- end
end
target_width = Reline::Unicode.calculate_width(target)
x = cursor_pos.x - target_width