summaryrefslogtreecommitdiffstats
path: root/mycli/key_bindings.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 06:40:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-08 06:40:49 +0000
commit009d0b0f17cc82919a683a1ecb6a334f5354090d (patch)
treea892178f3bfd61e0f42ccb31c17d54165d370ae9 /mycli/key_bindings.py
parentReleasing debian version 1.23.2-2. (diff)
downloadmycli-009d0b0f17cc82919a683a1ecb6a334f5354090d.tar.xz
mycli-009d0b0f17cc82919a683a1ecb6a334f5354090d.zip
Merging upstream version 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.py8
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