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.master
parent
b2ff574678
commit
ab0897072a
12
src/winio.c
12
src/winio.c
|
@ -1094,10 +1094,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
|
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
|
||||||
return KEY_PPAGE;
|
return KEY_PPAGE;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
else if (length > 4 && seq[2] == ';' &&
|
else if (length > 4 && seq[2] == ';' && seq[4] == '~') {
|
||||||
seq[3] == '2' && seq[4] == '~') {
|
|
||||||
*consumed = 5;
|
*consumed = 5;
|
||||||
return shiftaltup;
|
if (seq[3] == '2')
|
||||||
|
return shiftaltup;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -1107,10 +1107,10 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
|
if (length > 2 && (seq[2] == '~' || seq[2] == '^'))
|
||||||
return KEY_NPAGE;
|
return KEY_NPAGE;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
else if (length > 4 && seq[2] == ';' &&
|
else if (length > 4 && seq[2] == ';' && seq[4] == '~') {
|
||||||
seq[3] == '2' && seq[4] == '~') {
|
|
||||||
*consumed = 5;
|
*consumed = 5;
|
||||||
return shiftaltdown;
|
if (seq[3] == '2')
|
||||||
|
return shiftaltdown;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue