##// END OF EJS Templates
Merge pull request #12132 from blueyed/debugger-shortcuts...
Matthias Bussonnier -
r25534:1b7ac225 merge
parent child Browse files
Show More
@@ -6,7 +6,7 b' from IPython.core.debugger import Pdb'
6
6
7 from IPython.core.completer import IPCompleter
7 from IPython.core.completer import IPCompleter
8 from .ptutils import IPythonPTCompleter
8 from .ptutils import IPythonPTCompleter
9 from .shortcuts import suspend_to_bg, cursor_in_leading_ws
9 from .shortcuts import create_ipython_shortcuts, suspend_to_bg, cursor_in_leading_ws
10
10
11 from prompt_toolkit.enums import DEFAULT_BUFFER
11 from prompt_toolkit.enums import DEFAULT_BUFFER
12 from prompt_toolkit.filters import (Condition, has_focus, has_selection,
12 from prompt_toolkit.filters import (Condition, has_focus, has_selection,
@@ -42,21 +42,10 b' class TerminalPdb(Pdb):'
42 )
42 )
43 self._ptcomp = IPythonPTCompleter(compl)
43 self._ptcomp = IPythonPTCompleter(compl)
44
44
45 kb = KeyBindings()
46 supports_suspend = Condition(lambda: hasattr(signal, 'SIGTSTP'))
47 kb.add('c-z', filter=supports_suspend)(suspend_to_bg)
48
49 if self.shell.display_completions == 'readlinelike':
50 kb.add('tab', filter=(has_focus(DEFAULT_BUFFER)
51 & ~has_selection
52 & vi_insert_mode | emacs_insert_mode
53 & ~cursor_in_leading_ws
54 ))(display_completions_like_readline)
55
56 options = dict(
45 options = dict(
57 message=(lambda: PygmentsTokens(get_prompt_tokens())),
46 message=(lambda: PygmentsTokens(get_prompt_tokens())),
58 editing_mode=getattr(EditingMode, self.shell.editing_mode.upper()),
47 editing_mode=getattr(EditingMode, self.shell.editing_mode.upper()),
59 key_bindings=kb,
48 key_bindings=create_ipython_shortcuts(self.shell),
60 history=self.shell.debugger_history,
49 history=self.shell.debugger_history,
61 completer=self._ptcomp,
50 completer=self._ptcomp,
62 enable_history_search=True,
51 enable_history_search=True,
General Comments 0
You need to be logged in to leave comments. Login now