summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-12-09 14:20:25 +0900
committeraycabta <aycabta@gmail.com>2019-12-09 14:21:20 +0900
commita14c01441b12552386c69233b0bcc53d06ed0b92 (patch)
tree3756a1c6ae077aaade466a0c3879c0254a1af3d2
parent3cdb37d9db9b7776f6adf96c70eacc39773718b4 (diff)
Fix encoding compatibility checking of completion correctly
-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 f029aa4e6e6..e352f8881cc 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -549,7 +549,7 @@ class Reline::LineEditor
private def complete_internal_proc(list, is_menu)
preposing, target, postposing = retrieve_completion_block
list = list.select { |i|
- if i and i.encoding != Encoding::US_ASCII and i.encoding != @encoding
+ if i and not Encoding.compatible?(target.encoding, i.encoding)
raise Encoding::CompatibilityError
end
i&.start_with?(target)