By default, during debugging in IPython, ipdb shows one line above and one line below the current position in code.
Is there an easy way to make the area shown a bit bigger? I’d think it would be configurable, but haven’t been able to find it.
OK, I found the place in the IPython source code to do this. In my installation it’s at
def print_stack_entry(self,frame_lineno,prompt_prefix='n-> ', context = 3):
def print_stack_entry(self,frame_lineno,prompt_prefix='n-> ', context = 11):
It is awesome!
For IPython 4.0.1, in debugger.py just add this:
class Pdb(OldPdb): """Modified Pdb class, does not load readline.""" def __init__(self,color_scheme='NoColor',completekey=None, stdin=None, stdout=None, context=None): context=20