Fix for tab completion when there is no commonprefix. Like when matching magics in ipython

This commit is contained in:
Jorgen Stenarson
2010-08-25 18:55:25 +02:00
parent b656ba1f3a
commit 82689c3ba3
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -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
+5 -4
View File
@@ -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)