summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-12 23:39:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-12 23:39:28 -0700
commit1bdd343418bdf65f8c7aa95ed21d6d0fe4730237 (patch)
treeee4d2150c3a70085b8f47efadf765aa26abf2e32
parentdb7a6684a1212f8a900b1a07bb2e9c4c87cd9586 (diff)
downloadtxr-1bdd343418bdf65f8c7aa95ed21d6d0fe4730237.tar.gz
txr-1bdd343418bdf65f8c7aa95ed21d6d0fe4730237.tar.bz2
txr-1bdd343418bdf65f8c7aa95ed21d6d0fe4730237.zip
linenoise: incorrect ESC treatment in completion.
* linenoise/linenoise.c (complete_line): ESC must not be treated specially when leaving completion mode; it must accept the completed line. The original code did this wrong in my opinion and I propagated the error. * txr.1: Remove all mention of special ESC treatment in completion mode.
-rw-r--r--linenoise/linenoise.c4
-rw-r--r--txr.113
2 files changed, 2 insertions, 15 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index ffbd38e4..0ea057ab 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -338,12 +338,10 @@ static int complete_line(lino_t *ls) {
if (i == lc.len) generate_beep(ls);
break;
case CTL('C'):
- c = 0;
- /* fallthrough */
- case ESC:
/* Re-show original buffer */
if (i < lc.len) refresh_line(ls);
stop = 1;
+ c = 0;
break;
default:
/* Update buffer and return */
diff --git a/txr.1 b/txr.1
index 7edd2e0e..c7cf6171 100644
--- a/txr.1
+++ b/txr.1
@@ -33624,21 +33624,10 @@ in. The other completions may be viewed one by one using the Tab key.
When the completions are exhausted, the original uncompleted line is shown
again, and Tab can continue to be used to cycle through the completions again.
In completion mode, the Ctrl-C character acts as a command to cancel completion mode
-and return to editing the original uncompleted line. The ESC character
-similarly cancels completion, restoring the original line, but unlike Ctrl-C,
-it is then processed in regular editing mode. Any other input character causes
+and return to editing the original uncompleted line. Any other input character causes
the listener to keep the currently shown completion, and return to edit mode,
where that that character is processed again as a command.
-Note: the peculiar behavior for the ESC character in completion mode is
-intended to handles situations in which an arrow key is used while in
-completion mode. When any arrow key is pressed, the line is restored and then
-the arrow key is processed in ordinary mode (translating to an editing
-movement or history navigation). The connection between ESC and arrow keys
-is that arrow keys (and other special command keys) are represented, by a
-VT100-compatible terminal or terminal emulator, as special sequences of
-bytes beginning with ESC (known as "escape sequences").
-
.SS* Reading Forms Directly from the Terminal
The listener is currently line oriented. There is, however, support for