diff options
author | aycabta <aycabta@gmail.com> | 2019-11-08 16:17:53 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-11-08 16:18:36 +0900 |
commit | 6e72b72881b42e28d2f97ee023587e3d071fb64b (patch) | |
tree | ba3fdb6ac404421e797eee126b425f954647a0c5 /lib/reline.rb | |
parent | 83c563cfa403af1141fc0080d2b6eec344db6726 (diff) | |
download | ruby-6e72b72881b42e28d2f97ee023587e3d071fb64b.tar.gz |
Suppress "shadowing outer local variable" warning in 2.5
Diffstat (limited to 'lib/reline.rb')
-rw-r--r-- | lib/reline.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index f7678074de..f5c0f5ef69 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -260,7 +260,10 @@ module Reline result = key_stroke.match_status(buffer) case result when :matched - block.(key_stroke.expand(buffer).map{ |c| Reline::Key.new(c, c, false) }) + expanded = key_stroke.expand(buffer).map{ |expanded_c| + Reline::Key.new(expanded_c, expanded_c, false) + } + block.(expanded) break when :matching if buffer.size == 1 @@ -289,7 +292,10 @@ module Reline if buffer.size == 1 and c == "\e".ord read_escaped_key(keyseq_timeout, c, block) else - block.(buffer.map{ |c| Reline::Key.new(c, c, false) }) + expanded = buffer.map{ |expanded_c| + Reline::Key.new(expanded_c, expanded_c, false) + } + block.(expanded) end break end |