mirror of
https://github.com/wassname/pyreadline.git
synced 2026-06-27 16:10:38 +08:00
Fix for tab completion when there is no commonprefix. Like when matching magics in ipython
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
SET VERSION=1.6
|
||||
SET VERSION=1.6.1
|
||||
python setup.py build_sphinx
|
||||
python setup.py build_sphinx -b latex
|
||||
|
||||
|
||||
@@ -252,10 +252,11 @@ class BaseMode(object):
|
||||
completions = self._get_completions()
|
||||
if completions:
|
||||
cprefix = commonprefix(completions)
|
||||
rep = [ c for c in cprefix ]
|
||||
point=self.l_buffer.point
|
||||
self.l_buffer[self.begidx:self.endidx] = rep
|
||||
self.l_buffer.point = point + len(rep) - (self.endidx - self.begidx)
|
||||
if len(cprefix) > 0:
|
||||
rep = [ c for c in cprefix ]
|
||||
point=self.l_buffer.point
|
||||
self.l_buffer[self.begidx:self.endidx] = rep
|
||||
self.l_buffer.point = point + len(rep) - (self.endidx - self.begidx)
|
||||
if len(completions) > 1:
|
||||
if self.show_all_if_ambiguous == u'on':
|
||||
self._display_completions(completions)
|
||||
|
||||
Reference in New Issue
Block a user