MCPcopy Index your code
hub / github.com/ipython/ipython / vi_mode

Method vi_mode

IPython/terminal/prompts.py:21–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19 self.shell = shell
20
21 def vi_mode(self):
22 if (getattr(self.shell.pt_app, 'editing_mode', None) == EditingMode.VI
23 and self.shell.prompt_includes_vi_mode):
24 mode = str(self.shell.pt_app.app.vi_state.input_mode)
25 if mode.startswith('InputMode.'):
26 mode = mode[10:13].lower()
27 elif mode.startswith('vi-'):
28 mode = mode[3:6]
29 return '['+mode+'] '
30 return ''
31
32 def current_line(self) -> int:
33 if self.shell.pt_app is not None:

Callers 2

in_prompt_tokensMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected