1
0
forked from aniani/vim

patch 9.0.0974: even when Esc is encoded a timeout is used

Problem:    Even when Esc is encoded a timeout is used.
Solution:   Use K_ESC when an encoded Esc is found.
This commit is contained in:
Bram Moolenaar
2022-11-29 20:33:20 +00:00
parent 064fd67e6a
commit dffa6ea85c
4 changed files with 33 additions and 2 deletions

View File

@@ -278,13 +278,16 @@ enum key_extra
, KE_SCRIPT_COMMAND = 104 // <ScriptCmd> special key
, KE_S_BS = 105 // shift + <BS>
, KE_SID = 106 // <SID> special key, followed by {nr};
, KE_ESC = 107 // used for K_ESC
};
/*
* the three byte codes are replaced with the following int when using vgetc()
* The three-byte codes are replaced with a negative number when using vgetc().
*/
#define K_ZERO TERMCAP2KEY(KS_ZERO, KE_FILLER)
#define K_ESC TERMCAP2KEY(KS_EXTRA, KE_ESC)
#define K_UP TERMCAP2KEY('k', 'u')
#define K_DOWN TERMCAP2KEY('k', 'd')
#define K_LEFT TERMCAP2KEY('k', 'l')
@@ -295,10 +298,12 @@ enum key_extra
#define K_C_LEFT TERMCAP2KEY(KS_EXTRA, KE_C_LEFT)
#define K_S_RIGHT TERMCAP2KEY('%', 'i')
#define K_C_RIGHT TERMCAP2KEY(KS_EXTRA, KE_C_RIGHT)
#define K_S_HOME TERMCAP2KEY('#', '2')
#define K_C_HOME TERMCAP2KEY(KS_EXTRA, KE_C_HOME)
#define K_S_END TERMCAP2KEY('*', '7')
#define K_C_END TERMCAP2KEY(KS_EXTRA, KE_C_END)
#define K_TAB TERMCAP2KEY(KS_EXTRA, KE_TAB)
#define K_S_TAB TERMCAP2KEY('k', 'B')
#define K_S_BS TERMCAP2KEY(KS_EXTRA, KE_S_BS)