xC: define critical bindings after el_source()

And use ^C rather than ^G.
This commit is contained in:
Přemysl Eric Janouch 2022-09-06 16:40:31 +02:00
parent cf14cb8122
commit 2d30b6d115
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 6 additions and 7 deletions

13
xC.c
View File

@ -1032,7 +1032,7 @@ input_el__restore (struct input_el *self)
static void
input_el__start_over (struct input_el *self)
{
wchar_t x[] = { L'g' & 31, 0 };
wchar_t x[] = { L'c' & 31, 0 };
el_wpush (self->editline, x);
int dummy_count = 0;
@ -14527,12 +14527,6 @@ app_editline_init (struct input_el *self)
// Just what are you doing?
CALL_ (input, bind_control, 'u', "vi-kill-line-prev");
// See input_el__redisplay(), functionally important
CALL_ (input, bind_control, 'q', "ed-redisplay");
// This is what buffered el_wgets() does, functionally important;
// perhaps it could be bound somewhere more appropriate
CALL_ (input, bind_control, 'g', "ed-start-over");
// We need to hide the prompt and input first
CALL_ (input, bind, "\r", "send-line");
CALL_ (input, bind, "\n", "send-line");
@ -14541,6 +14535,11 @@ app_editline_init (struct input_el *self)
// Source the user's defaults file
el_source (self->editline, NULL);
// See input_el__redisplay(), functionally important
CALL_ (input, bind_control, 'q', "ed-redisplay");
// This is what buffered el_wgets() does, functionally important
CALL_ (input, bind_control, 'c', "ed-start-over");
}
#endif // HAVE_EDITLINE