From 7a8b46816556339059878cf62dbe142552de953a Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 9 Oct 2006 11:15:29 +1000 Subject: [PATCH] Allow Meta-newline to always insert a newline character darcs-hash:20061009011529-ac50b-c8e3d77b569bc445e586c95aca01e4433fbff598.gz --- input.c | 26 ++++++++++++++++++++++---- input.h | 3 ++- reader.c | 12 +++++++++--- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/input.c b/input.c index 833e78083..406e4b2e2 100644 --- a/input.c +++ b/input.c @@ -130,7 +130,8 @@ static const wchar_t *name_arr[] = L"self-insert", L"null", L"eof", - L"vi-arg-digit" + L"vi-arg-digit", + L"execute" } ; @@ -207,7 +208,8 @@ static const wchar_t code_arr[] = R_SELF_INSERT, R_NULL, R_EOF, - R_VI_ARG_DIGIT + R_VI_ARG_DIGIT, + R_EXECUTE } ; @@ -1222,6 +1224,14 @@ static void add_common_bindings() */ for( i=0; i<3; i++ ) { + add_mapping( name[i], L"\n", L"Execute contents of commandline", L"execute" ); + + /* + This will make Meta-newline insert a newline, since + self-insert ignored the escape character unless it is the + only character of the sequence. + */ + add_mapping( name[i], L"\e\n", L"Meta-newline", L"self-insert" ); /* We need alternative keybidnings for arrowkeys, since terminfo sometimes specifies a different sequence than what @@ -1509,6 +1519,7 @@ static wint_t input_exec_binding( mapping *m, const wchar_t *seq ) { switch( code ) { + case R_DUMP_FUNCTIONS: { for( i=0; i31) && (c != 127) ) + if( (!wchar_private(c)) && (( (c>31) || (c=L'\n'))&& (c != 127)) ) + { insert_char( c ); + } else { /*