From 1ce4babe36ec4f7bc2548dac42ea316dcc2d7da7 Mon Sep 17 00:00:00 2001 From: David Halter Date: Sat, 17 Aug 2013 19:17:07 +0430 Subject: [PATCH] fix a problem in readline completion with upper/lower cases --- jedi/utils.py | 2 ++ test/test_utils.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/jedi/utils.py b/jedi/utils.py index f6e78348..4632a989 100644 --- a/jedi/utils.py +++ b/jedi/utils.py @@ -80,5 +80,7 @@ def setup_readline(namespace_module=__main__): else: readline.set_completer(JediRL().complete) readline.parse_and_bind("tab: complete") + # jedi itself does the case matching + readline.parse_and_bind("set completion-ignore-case on") # No delimiters, Jedi handles that. readline.set_completer_delims('') diff --git a/test/test_utils.py b/test/test_utils.py index 7903ded1..2ffee08b 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -55,6 +55,10 @@ class TestSetupReadline(TestCase): del self.namespace.sys del self.namespace.os + def test_calls(self): + s = 'str(bytes' + assert self.completions(s) == [s, 'str(BytesWarning'] + def test_import(self): s = 'from os.path import a' assert set(self.completions(s)) == set([s + 'ltsep', s + 'bspath'])