##// END OF EJS Templates
Adding VI-mode in prompt...
Jonathan Feinberg -
Show More
@@ -7,6 +7,7 b' from IPython.core.displayhook import DisplayHook'
7
7
8 from prompt_toolkit.formatted_text import fragment_list_width, PygmentsTokens
8 from prompt_toolkit.formatted_text import fragment_list_width, PygmentsTokens
9 from prompt_toolkit.shortcuts import print_formatted_text
9 from prompt_toolkit.shortcuts import print_formatted_text
10 from prompt_toolkit.enums import EditingMode
10
11
11
12
12 class Prompts(object):
13 class Prompts(object):
@@ -14,7 +15,7 b' class Prompts(object):'
14 self.shell = shell
15 self.shell = shell
15
16
16 def vi_mode(self):
17 def vi_mode(self):
17 if (getattr(self.shell.pt_app, 'editing_mode', None) == 'VI'
18 if (getattr(self.shell.pt_app, 'editing_mode', None) == EditingMode.VI
18 and self.shell.prompt_includes_vi_mode):
19 and self.shell.prompt_includes_vi_mode):
19 return '['+str(self.shell.pt_app.app.vi_state.input_mode)[3:6]+'] '
20 return '['+str(self.shell.pt_app.app.vi_state.input_mode)[3:6]+'] '
20 return ''
21 return ''
General Comments 0
You need to be logged in to leave comments. Login now