Commit ab089707 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

input: consume the whole escape sequence for modified PgUp and PgDn keys

Even when we don't act on most of these combinations, at least eat up
the whole sequence so the unknown keystroke doesn't enter things like
"3~" into the buffer.

This fixes https://savannah.gnu.org/bugs/?54291.
No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
......@@ -1094,10 +1094,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
return KEY_PPAGE;
#ifndef NANO_TINY
else if (length > 4 && seq[2] == ';' &&
seq[3] == '2' && seq[4] == '~') {
else if (length > 4 && seq[2] == ';' && seq[4] == '~') {
*consumed = 5;
return shiftaltup;
if (seq[3] == '2')
return shiftaltup;
}
#endif
break;
......@@ -1107,10 +1107,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
return KEY_NPAGE;
#ifndef NANO_TINY
else if (length > 4 && seq[2] == ';' &&
seq[3] == '2' && seq[4] == '~') {
else if (length > 4 && seq[2] == ';' && seq[4] == '~') {
*consumed = 5;
return shiftaltdown;
if (seq[3] == '2')
return shiftaltdown;
}
#endif
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment