diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-24 15:47:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-24 15:47:07 +0100 |
commit | 4893fc8dc5b54968be8949fe3b45fc7326cbb90f (patch) | |
tree | f766d309525eb9f9544d9e5c5262aabf063e084f /contrib/replxx/src/escape.cxx | |
parent | af4fca4b2a5543bc3838897fa603af2e0cdc210c (diff) | |
download | rspamd-4893fc8dc5b54968be8949fe3b45fc7326cbb90f.tar.gz rspamd-4893fc8dc5b54968be8949fe3b45fc7326cbb90f.zip |
[Minor] Update replxx library
Diffstat (limited to 'contrib/replxx/src/escape.cxx')
-rw-r--r-- | contrib/replxx/src/escape.cxx | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/contrib/replxx/src/escape.cxx b/contrib/replxx/src/escape.cxx index 3edc4c1ec..dda1ab0be 100644 --- a/contrib/replxx/src/escape.cxx +++ b/contrib/replxx/src/escape.cxx @@ -1,5 +1,5 @@ #include "escape.hxx" -#include "io.hxx" +#include "terminal.hxx" #include "replxx.hxx" #ifndef _WIN32 @@ -115,6 +115,12 @@ static char32_t ctrlRightArrowKeyRoutine(char32_t) { static char32_t ctrlLeftArrowKeyRoutine(char32_t) { return thisKeyMetaCtrl | Replxx::KEY::BASE_CONTROL | Replxx::KEY::LEFT; } +static char32_t bracketPasteStartKeyRoutine(char32_t) { + return thisKeyMetaCtrl | Replxx::KEY::PASTE_START; +} +static char32_t bracketPasteFinishKeyRoutine(char32_t) { + return thisKeyMetaCtrl | Replxx::KEY::PASTE_FINISH; +} static char32_t escFailureRoutine(char32_t) { beep(); return -1; @@ -442,11 +448,35 @@ static char32_t escLeftBracket20SemicolonRoutine(char32_t c) { return doDispatch(c, escLeftBracket20SemicolonDispatch); } +static CharacterDispatchRoutine escLeftBracket200Routines[] = { + bracketPasteStartKeyRoutine, escFailureRoutine +}; +static CharacterDispatch escLeftBracket200Dispatch = { + 1, "~", escLeftBracket200Routines +}; +static char32_t escLeftBracket200Routine(char32_t c) { + c = read_unicode_character(); + if (c == 0) return 0; + return doDispatch(c, escLeftBracket200Dispatch); +} + +static CharacterDispatchRoutine escLeftBracket201Routines[] = { + bracketPasteFinishKeyRoutine, escFailureRoutine +}; +static CharacterDispatch escLeftBracket201Dispatch = { + 1, "~", escLeftBracket201Routines +}; +static char32_t escLeftBracket201Routine(char32_t c) { + c = read_unicode_character(); + if (c == 0) return 0; + return doDispatch(c, escLeftBracket201Dispatch); +} + static CharacterDispatchRoutine escLeftBracket20Routines[] = { - f9KeyRoutine, escLeftBracket20SemicolonRoutine, escFailureRoutine + f9KeyRoutine, escLeftBracket20SemicolonRoutine, escLeftBracket200Routine, escLeftBracket201Routine, escFailureRoutine }; static CharacterDispatch escLeftBracket20Dispatch = { - 2, "~;", escLeftBracket20Routines + 4, "~;01", escLeftBracket20Routines }; static char32_t escLeftBracket20Routine(char32_t c) { c = read_unicode_character(); |