1
0
forked from aniani/vim

patch 9.0.1126: bracketed paste can be enabled when it is not recognized

Problem:    Bracketed paste can be enabled when pasted text is not recognized.
Solution:   Output t_BE only when t_PS and t_PE are set.
This commit is contained in:
Bram Moolenaar
2023-01-01 18:04:33 +00:00
parent ec8b74f7ab
commit fc966c19f8
6 changed files with 27 additions and 5 deletions

View File

@@ -3756,6 +3756,21 @@ out_str_t_TI(void)
send_t_RK = TRUE;
}
/*
* Output T_BE, but only when t_PS and t_PE are set.
*/
void
out_str_t_BE(void)
{
char_u *p;
if (T_BE == NULL || *T_BE == NUL
|| (p = find_termcode((char_u *)"PS")) == NULL || *p == NUL
|| (p = find_termcode((char_u *)"PE")) == NULL || *p == NUL)
return;
out_str(T_BE);
}
/*
* If t_TI was recently sent and there is no typeahead or work to do, now send
* t_RK. This is postponed to avoid the response arriving in a shell command
@@ -3834,7 +3849,7 @@ settmode(tmode_T tmode)
}
else
{
out_str(T_BE); // enable bracketed paste mode (should
out_str_t_BE(); // enable bracketed paste mode (should
// be before mch_settmode().
out_str_t_TI(); // possibly enables modifyOtherKeys
}
@@ -3862,7 +3877,7 @@ starttermcap(void)
out_str(T_TI); // start termcap mode
out_str_t_TI(); // start "raw" mode
out_str(T_KS); // start "keypad transmit" mode
out_str(T_BE); // enable bracketed paste mode
out_str_t_BE(); // enable bracketed paste mode
#if defined(UNIX) || defined(VMS)
// Enable xterm's focus reporting mode when 'esckeys' is set.