diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-08 06:39:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-08 06:39:52 +0000 |
commit | f96615a770febe0d511ad79d17169aca58095bf2 (patch) | |
tree | 60c586dcee842be1b061221a5fb454a153857585 /mycli/key_bindings.py | |
parent | Adding upstream version 1.23.2. (diff) | |
download | mycli-f96615a770febe0d511ad79d17169aca58095bf2.tar.xz mycli-f96615a770febe0d511ad79d17169aca58095bf2.zip |
Adding upstream version 1.24.1.upstream/1.24.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mycli/key_bindings.py')
-rw-r--r-- | mycli/key_bindings.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mycli/key_bindings.py b/mycli/key_bindings.py index 57b917b..4a24c82 100644 --- a/mycli/key_bindings.py +++ b/mycli/key_bindings.py @@ -78,8 +78,12 @@ def mycli_bindings(mycli): @kb.add('escape', 'enter') def _(event): - """Introduces a line break regardless of multi-line mode or not.""" + """Introduces a line break in multi-line mode, or dispatches the + command in single-line mode.""" _logger.debug('Detected alt-enter key.') - event.app.current_buffer.insert_text('\n') + if mycli.multi_line: + event.app.current_buffer.validate_and_handle() + else: + event.app.current_buffer.insert_text('\n') return kb |