summaryrefslogtreecommitdiffstats
path: root/linenoise
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-09-07 06:28:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-09-07 06:28:18 -0700
commitf7e9981975a28b36ae30340e11f3b79abd31e8b0 (patch)
tree8b3059aa4271df0dbdabde4b7a76fc45e262467f /linenoise
parente131e81e72f37d29bd237d0052bb9f6febd7ffd0 (diff)
downloadtxr-f7e9981975a28b36ae30340e11f3b79abd31e8b0.tar.gz
txr-f7e9981975a28b36ae30340e11f3b79abd31e8b0.tar.bz2
txr-f7e9981975a28b36ae30340e11f3b79abd31e8b0.zip
linenoise: bugfix: cancel extended mode on Enter.
* linenoise/linenoise.c (edit): If Enter is processed while in Ctrl-X extended command mode, that mode must be explicitly canceled by resetting the extended local flag. Not doing this became an issue when the Enter callback mechanism was introduced to detect incomplete lines. At that point, entering Ctrl-X Enter on an incomplete line caused linenoise to insert a newline, but stay in extended mode.
Diffstat (limited to 'linenoise')
-rw-r--r--linenoise/linenoise.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index a3c83e66..a80ca3ab 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -2015,6 +2015,7 @@ static int edit(lino_t *l, const char *prompt)
}
break;
case ENTER:
+ extended = 0;
if (l->mlmode && l->enter_callback &&
!l->enter_callback(l->data, l->ce_ctx))
{