File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,10 +68,15 @@ def reformat_and_execute(event):
6868 reformat_text_before_cursor (event .current_buffer , event .current_buffer .document , shell )
6969 event .current_buffer .validate_and_handle ()
7070
71- kb .add ('escape' , 'enter' , filter = (has_focus (DEFAULT_BUFFER )
72- & ~ has_selection
73- & insert_mode
74- ))(reformat_and_execute )
71+ @Condition
72+ def ebivim ():
73+ return shell .emacs_bindings_in_vi_insert_mode
74+
75+ kb .add (
76+ "escape" ,
77+ "enter" ,
78+ filter = (has_focus (DEFAULT_BUFFER ) & ~ has_selection & insert_mode & ebivim ),
79+ )(reformat_and_execute )
7580
7681 kb .add ("c-\\ " )(quit )
7782
@@ -333,10 +338,6 @@ def _(event):
333338 if sys .platform == "win32" :
334339 kb .add ("c-v" , filter = (has_focus (DEFAULT_BUFFER ) & ~ vi_mode ))(win_paste )
335340
336- @Condition
337- def ebivim ():
338- return shell .emacs_bindings_in_vi_insert_mode
339-
340341 focused_insert_vi = has_focus (DEFAULT_BUFFER ) & vi_insert_mode
341342
342343 @kb .add ("end" , filter = has_focus (DEFAULT_BUFFER ) & (ebivim | ~ vi_insert_mode ))
You can’t perform that action at this time.
0 commit comments