ipython/ipython — Issue #1305: completion problem in long (wrapped) lines in qtconsole
Author: airdrik
Created: 2012-01-20 23:08:33+00:00
State: open

If you have a long line that wraps onto a second (or more) line, then try to tab-complete something on the second line it mangles the thing being completed and doesn't show any completion options.

e.g. say you have the console window open with a width of 80 characters with the following code:

>>> class A:
...: def someMethodWithAReallyLongName(self):
...: pass
...: def someOtherMethodWithAReallyLongName(self):
...: pass
...:

>>> listOfLotsOfInstancesOfA = [A() for i in range(10)]

>>> instanceOfA = listOfLotsOfInstancesOfA[0]

then you have the following typed and hit tab (the '|' represents the current cursor position, the $ represents the wrap position):

>>> [instanceOfA.someMethodWithAReallyLongName() for instanceOfA in $listOfLotsOfInstancesOfA if inst|

then it replaces the text with:

>>> [instanceOfA.someMethodWithAReallyLongName() for instanceOfA in $listOinstanceOfA.someMethodWithAReallyLongName|