Skip to content

Commit

Permalink
patch 9.0.1117: terminfo entries for bracketed paste are not used
Browse files Browse the repository at this point in the history
Problem:    Terminfo entries for bracketed paste are not used.
Solution:   Use the newly added terminfo entries for bracketed paste.
            Correct mixup of output strings and key codes.
  • Loading branch information
brammool committed Dec 30, 2022
1 parent 7707137 commit 7b8db11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/term.c
Expand Up @@ -1674,6 +1674,7 @@ static char *(key_names[]) =
"k7", "k8", "k9", "k;", "F1", "F2",
"%1", "&8", "kb", "kI", "kD", "kh",
"@7", "kP", "kN", "K1", "K3", "K4", "K5", "kB",
"PS", "PE",
NULL
};
#endif
Expand Down Expand Up @@ -1730,13 +1731,11 @@ get_term_entries(int *height, int *width)
{KS_U7, "u7"}, {KS_RFG, "RF"}, {KS_RBG, "RB"},
{KS_8F, "8f"}, {KS_8B, "8b"}, {KS_8U, "8u"},
{KS_CBE, "BE"}, {KS_CBD, "BD"},
{KS_CPS, "PS"}, {KS_CPE, "PE"},
{KS_CST, "ST"}, {KS_CRT, "RT"},
{KS_SSI, "Si"}, {KS_SRI, "Ri"},
{(enum SpecialKey)0, NULL}
};
int i;
char_u *p;
static char_u tstrbuf[TBUFSZ];
char_u *tp = tstrbuf;

Expand Down Expand Up @@ -1775,7 +1774,8 @@ get_term_entries(int *height, int *width)
for (i = 0; key_names[i] != NULL; ++i)
if (find_termcode((char_u *)key_names[i]) == NULL)
{
p = TGETSTR(key_names[i], &tp);
char_u *p = TGETSTR(key_names[i], &tp);

// if cursor-left == backspace, ignore it (televideo 925)
if (p != NULL
&& (*p != Ctrl_H
Expand Down Expand Up @@ -1803,8 +1803,8 @@ get_term_entries(int *height, int *width)
# ifndef hpux
BC = (char *)TGETSTR("bc", &tp);
UP = (char *)TGETSTR("up", &tp);
p = TGETSTR("pc", &tp);
if (p)
char_u *p = TGETSTR("pc", &tp);
if (p != NULL)
PC = *p;
# endif
}
Expand Down
4 changes: 0 additions & 4 deletions src/termdefs.h
Expand Up @@ -108,8 +108,6 @@ enum SpecialKey
KS_8U, // set underline color (RGB)
KS_CBE, // enable bracketed paste mode
KS_CBD, // disable bracketed paste mode
KS_CPS, // start of bracketed paste
KS_CPE, // end of bracketed paste
KS_CST, // save window title
KS_CRT, // restore window title
KS_SSI, // save icon text
Expand Down Expand Up @@ -216,8 +214,6 @@ extern char_u *(term_strings[]); // current terminal strings
#define T_8U (TERM_STR(KS_8U)) // set underline color (RGB)
#define T_BE (TERM_STR(KS_CBE)) // enable bracketed paste mode
#define T_BD (TERM_STR(KS_CBD)) // disable bracketed paste mode
#define T_PS (TERM_STR(KS_CPS)) // start of bracketed paste
#define T_PE (TERM_STR(KS_CPE)) // end of bracketed paste
#define T_CST (TERM_STR(KS_CST)) // save window title
#define T_CRT (TERM_STR(KS_CRT)) // restore window title
#define T_SSI (TERM_STR(KS_SSI)) // save icon text
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1117,
/**/
1116,
/**/
Expand Down

0 comments on commit 7b8db11

Please sign in to comment.