1
0
forked from VimPlug/jedi

fix a problem in readline completion with upper/lower cases

This commit is contained in:
David Halter
2013-08-17 19:17:07 +04:30
parent e46d33be90
commit 1ce4babe36
2 changed files with 6 additions and 0 deletions

View File

@@ -80,5 +80,7 @@ def setup_readline(namespace_module=__main__):
else: else:
readline.set_completer(JediRL().complete) readline.set_completer(JediRL().complete)
readline.parse_and_bind("tab: 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. # No delimiters, Jedi handles that.
readline.set_completer_delims('') readline.set_completer_delims('')

View File

@@ -55,6 +55,10 @@ class TestSetupReadline(TestCase):
del self.namespace.sys del self.namespace.sys
del self.namespace.os del self.namespace.os
def test_calls(self):
s = 'str(bytes'
assert self.completions(s) == [s, 'str(BytesWarning']
def test_import(self): def test_import(self):
s = 'from os.path import a' s = 'from os.path import a'
assert set(self.completions(s)) == set([s + 'ltsep', s + 'bspath']) assert set(self.completions(s)) == set([s + 'ltsep', s + 'bspath'])