build: exclude the escape sequences for F13...F16 from the tiny version
The F13 to F16 function keys are no longer bound by default, and when there is no nanorc file, there is no way to bind them, so there is no point in recognizing their escape sequences.master
parent
67b89459d5
commit
84b305f3f0
13
src/winio.c
13
src/winio.c
|
@ -818,11 +818,13 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
case 'D': /* Esc O 1 ; 2 D == Shift-Left on Terminal. */
|
case 'D': /* Esc O 1 ; 2 D == Shift-Left on Terminal. */
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return arrow_from_ABCD(seq[4]);
|
return arrow_from_ABCD(seq[4]);
|
||||||
|
#ifdef ENABLE_NANORC
|
||||||
case 'P': /* Esc O 1 ; 2 P == F13 on Gnome Terminal. */
|
case 'P': /* Esc O 1 ; 2 P == F13 on Gnome Terminal. */
|
||||||
case 'Q': /* Esc O 1 ; 2 Q == F14 on Gnome Terminal. */
|
case 'Q': /* Esc O 1 ; 2 Q == F14 on Gnome Terminal. */
|
||||||
case 'R': /* Esc O 1 ; 2 R == F15 on Gnome Terminal. */
|
case 'R': /* Esc O 1 ; 2 R == F15 on Gnome Terminal. */
|
||||||
case 'S': /* Esc O 1 ; 2 S == F16 on Gnome Terminal. */
|
case 'S': /* Esc O 1 ; 2 S == F16 on Gnome Terminal. */
|
||||||
return KEY_F(13 + seq[4] - 'P');
|
return KEY_F(13 + seq[4] - 'P');
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
|
@ -844,12 +846,14 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
case '2':
|
case '2':
|
||||||
if (length > 2) {
|
if (length > 2) {
|
||||||
*consumed = 3;
|
*consumed = 3;
|
||||||
|
#ifdef ENABLE_NANORC
|
||||||
if ('O' < seq[2] && seq[2] < 'T')
|
if ('O' < seq[2] && seq[2] < 'T')
|
||||||
/* Esc O 2 P == F13 on Konsole. */
|
/* Esc O 2 P == F13 on Konsole. */
|
||||||
/* Esc O 2 Q == F14 on Konsole. */
|
/* Esc O 2 Q == F14 on Konsole. */
|
||||||
/* Esc O 2 R == F15 on Konsole. */
|
/* Esc O 2 R == F15 on Konsole. */
|
||||||
/* Esc O 2 S == F16 on Konsole. */
|
/* Esc O 2 S == F16 on Konsole. */
|
||||||
return KEY_F(13 + seq[2] - 'P');
|
return KEY_F(13 + seq[2] - 'P');
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
|
@ -977,6 +981,8 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
return SHIFT_END;
|
return SHIFT_END;
|
||||||
case 'H': /* Esc [ 1 ; 2 H == Shift-Home on xterm. */
|
case 'H': /* Esc [ 1 ; 2 H == Shift-Home on xterm. */
|
||||||
return SHIFT_HOME;
|
return SHIFT_HOME;
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_NANORC
|
||||||
case 'P': /* Esc [ 1 ; 2 P == F13 on xterm. */
|
case 'P': /* Esc [ 1 ; 2 P == F13 on xterm. */
|
||||||
case 'Q': /* Esc [ 1 ; 2 Q == F14 on xterm. */
|
case 'Q': /* Esc [ 1 ; 2 Q == F14 on xterm. */
|
||||||
case 'R': /* Esc [ 1 ; 2 R == F15 on xterm. */
|
case 'R': /* Esc [ 1 ; 2 R == F15 on xterm. */
|
||||||
|
@ -1064,15 +1070,20 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
|
||||||
case '1': /* Esc [ 2 1 ~ == F10 on the same. */
|
case '1': /* Esc [ 2 1 ~ == F10 on the same. */
|
||||||
return KEY_F(10);
|
return KEY_F(10);
|
||||||
case '3': /* Esc [ 2 3 ~ == F11 on the same. */
|
case '3': /* Esc [ 2 3 ~ == F11 on the same. */
|
||||||
|
return KEY_F(11);
|
||||||
case '4': /* Esc [ 2 4 ~ == F12 on the same. */
|
case '4': /* Esc [ 2 4 ~ == F12 on the same. */
|
||||||
|
return KEY_F(12);
|
||||||
|
#ifdef ENABLE_NANORC
|
||||||
case '5': /* Esc [ 2 5 ~ == F13 on VT220/VT320/
|
case '5': /* Esc [ 2 5 ~ == F13 on VT220/VT320/
|
||||||
* Linux console/rxvt/Eterm. */
|
* Linux console/rxvt/Eterm. */
|
||||||
|
return KEY_F(13);
|
||||||
case '6': /* Esc [ 2 6 ~ == F14 on the same. */
|
case '6': /* Esc [ 2 6 ~ == F14 on the same. */
|
||||||
return KEY_F(11 + seq[2] - '3');
|
return KEY_F(14);
|
||||||
case '8': /* Esc [ 2 8 ~ == F15 on the same. */
|
case '8': /* Esc [ 2 8 ~ == F15 on the same. */
|
||||||
return KEY_F(15);
|
return KEY_F(15);
|
||||||
case '9': /* Esc [ 2 9 ~ == F16 on the same. */
|
case '9': /* Esc [ 2 9 ~ == F16 on the same. */
|
||||||
return KEY_F(16);
|
return KEY_F(16);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else if (length > 2 && seq[2] == '~')
|
} else if (length > 2 && seq[2] == '~')
|
||||||
/* Esc [ 2 ~ == Insert on VT220/VT320/
|
/* Esc [ 2 ~ == Insert on VT220/VT320/
|
||||||
|
|
Loading…
Reference in New Issue