Fix behavior of enter key in VI_MODE

This commit is contained in:
Gil Forsyth 2019-07-13 18:36:41 -04:00
parent 8576e9c22e
commit f4f82903b5
Failed to generate hash of commit
2 changed files with 26 additions and 2 deletions

24
news/vi_mode_enter.rst Normal file
View file

@ -0,0 +1,24 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Hitting ``Enter`` while ``$VI_MODE=True`` now executes the current code block
irrespective of cursor position
**Security:**
* <news item>

View file

@ -304,8 +304,8 @@ def load_xonsh_bindings(key_bindings):
b.validate_and_handle()
xonsh_exit([])
@handle(Keys.ControlJ, filter=IsMultiline())
@handle(Keys.ControlM, filter=IsMultiline())
@handle(Keys.ControlJ, filter=IsMultiline() & insert_mode)
@handle(Keys.ControlM, filter=IsMultiline() & insert_mode)
def multiline_carriage_return(event):
""" Wrapper around carriage_return multiline parser """
b = event.cli.current_buffer