mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 04:21:24 +08:00
Allow Ctrl-D to return EOF
This commit reverts parts of 111fc5e
, which originally was intended to
add support for custom key bindings at pos 0, or more specifically, to
be able to change the behavior of Ctrl-D. However this completely broke
compatibility with the original EOF behavior.
Signed-off-by: Toby Goodwin <toby@paccrat.org>
Signed-off-by: Joachim Nilsson <joachim.nilsson@westermo.se>
This commit is contained in:
parent
256e6106c7
commit
a2bc89db64
@ -124,7 +124,6 @@ char **(*rl_attempted_completion_function)(const char *token, int start, int end
|
|||||||
|
|
||||||
/* Declarations. */
|
/* Declarations. */
|
||||||
static char *editinput(void);
|
static char *editinput(void);
|
||||||
static int is_ctl_map_key(int key);
|
|
||||||
#ifdef CONFIG_USE_TERMCAP
|
#ifdef CONFIG_USE_TERMCAP
|
||||||
extern char *tgetstr(const char *, char **);
|
extern char *tgetstr(const char *, char **);
|
||||||
extern int tgetent(char *, const char *);
|
extern int tgetent(char *, const char *);
|
||||||
@ -954,9 +953,6 @@ static el_status_t tty_special(int c)
|
|||||||
return kill_line();
|
return kill_line();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_ctl_map_key(c))
|
|
||||||
return CSdispatch;
|
|
||||||
|
|
||||||
if (c == rl_eof && rl_point == 0 && rl_end == 0)
|
if (c == rl_eof && rl_point == 0 && rl_end == 0)
|
||||||
return CSeof;
|
return CSeof;
|
||||||
|
|
||||||
@ -1694,13 +1690,6 @@ static size_t find_key_in_map(int key, el_keymap_t map[], size_t mapsz)
|
|||||||
return mapsz;
|
return mapsz;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_ctl_map_key(int key)
|
|
||||||
{
|
|
||||||
size_t mapsz = ARRAY_ELEMENTS(Map);
|
|
||||||
|
|
||||||
return mapsz != find_key_in_map(key, Map, mapsz);
|
|
||||||
}
|
|
||||||
|
|
||||||
static el_status_t el_bind_key_in_map(int key, el_keymap_func_t function, el_keymap_t map[], size_t mapsz)
|
static el_status_t el_bind_key_in_map(int key, el_keymap_func_t function, el_keymap_t map[], size_t mapsz)
|
||||||
{
|
{
|
||||||
size_t creat, pos = find_key_in_map(key, map, mapsz);
|
size_t creat, pos = find_key_in_map(key, map, mapsz);
|
||||||
|
Loading…
Reference in New Issue
Block a user