##// END OF EJS Templates
Fix vi mode escape delay
Jake Herrmann -
Show More
@@ -68,9 +68,14 b' def create_ipython_shortcuts(shell):'
68 reformat_text_before_cursor(event.current_buffer, event.current_buffer.document, shell)
68 reformat_text_before_cursor(event.current_buffer, event.current_buffer.document, shell)
69 event.current_buffer.validate_and_handle()
69 event.current_buffer.validate_and_handle()
70
70
71 @Condition
72 def ebivim():
73 return shell.emacs_bindings_in_vi_insert_mode
74
71 kb.add('escape', 'enter', filter=(has_focus(DEFAULT_BUFFER)
75 kb.add('escape', 'enter', filter=(has_focus(DEFAULT_BUFFER)
72 & ~has_selection
76 & ~has_selection
73 & insert_mode
77 & insert_mode
78 & ebivim
74 ))(reformat_and_execute)
79 ))(reformat_and_execute)
75
80
76 kb.add("c-\\")(quit)
81 kb.add("c-\\")(quit)
@@ -333,10 +338,6 b' def create_ipython_shortcuts(shell):'
333 if sys.platform == "win32":
338 if sys.platform == "win32":
334 kb.add("c-v", filter=(has_focus(DEFAULT_BUFFER) & ~vi_mode))(win_paste)
339 kb.add("c-v", filter=(has_focus(DEFAULT_BUFFER) & ~vi_mode))(win_paste)
335
340
336 @Condition
337 def ebivim():
338 return shell.emacs_bindings_in_vi_insert_mode
339
340 focused_insert_vi = has_focus(DEFAULT_BUFFER) & vi_insert_mode
341 focused_insert_vi = has_focus(DEFAULT_BUFFER) & vi_insert_mode
341
342
342 @kb.add("end", filter=has_focus(DEFAULT_BUFFER) & (ebivim | ~vi_insert_mode))
343 @kb.add("end", filter=has_focus(DEFAULT_BUFFER) & (ebivim | ~vi_insert_mode))
General Comments 0
You need to be logged in to leave comments. Login now