|
Karsten Hopp |
51da7c |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
51da7c |
Subject: Patch 7.4.770
|
|
Karsten Hopp |
51da7c |
Fcc: outbox
|
|
Karsten Hopp |
51da7c |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
51da7c |
Mime-Version: 1.0
|
|
Karsten Hopp |
51da7c |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
51da7c |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
51da7c |
------------
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
Patch 7.4.770 (after 7.4.766)
|
|
Karsten Hopp |
51da7c |
Problem: Background color response with transparency is not ignored.
|
|
Karsten Hopp |
51da7c |
Solution: Change the way escape sequences are recognized. (partly by
|
|
Karsten Hopp |
51da7c |
Hirohito Higashi)
|
|
Karsten Hopp |
51da7c |
Files: src/ascii.h, src/term.c
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
*** ../vim-7.4.769/src/ascii.h 2011-12-17 21:38:36.000000000 +0100
|
|
Karsten Hopp |
51da7c |
--- src/ascii.h 2015-07-10 12:02:02.379313390 +0200
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 34,43 ****
|
|
Karsten Hopp |
51da7c |
#define ESC_STR_nc "\033"
|
|
Karsten Hopp |
51da7c |
#define DEL 0x7f
|
|
Karsten Hopp |
51da7c |
#define DEL_STR (char_u *)"\177"
|
|
Karsten Hopp |
51da7c |
- #define CSI 0x9b /* Control Sequence Introducer */
|
|
Karsten Hopp |
51da7c |
- #define CSI_STR "\233"
|
|
Karsten Hopp |
51da7c |
- #define DCS 0x90 /* Device Control String */
|
|
Karsten Hopp |
51da7c |
- #define STERM 0x9c /* String Terminator */
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
#define POUND 0xA3
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
--- 34,39 ----
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 117,127 ****
|
|
Karsten Hopp |
51da7c |
#define ESC_STR_nc "\x27"
|
|
Karsten Hopp |
51da7c |
#define DEL 0x07
|
|
Karsten Hopp |
51da7c |
#define DEL_STR (char_u *)"\007"
|
|
Karsten Hopp |
51da7c |
- /* TODO: EBCDIC Code page dependent (here 1047) */
|
|
Karsten Hopp |
51da7c |
- #define CSI 0x9b /* Control Sequence Introducer */
|
|
Karsten Hopp |
51da7c |
- #define CSI_STR "\233"
|
|
Karsten Hopp |
51da7c |
- #define DCS 0x90 /* Device Control String */
|
|
Karsten Hopp |
51da7c |
- #define STERM 0x9c /* String Terminator */
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
#define POUND 0xB1
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
--- 113,118 ----
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 173,178 ****
|
|
Karsten Hopp |
51da7c |
--- 164,176 ----
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
#endif /* defined EBCDIC */
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
+ /* TODO: EBCDIC Code page dependent (here 1047) */
|
|
Karsten Hopp |
51da7c |
+ #define CSI 0x9b /* Control Sequence Introducer */
|
|
Karsten Hopp |
51da7c |
+ #define CSI_STR "\233"
|
|
Karsten Hopp |
51da7c |
+ #define DCS 0x90 /* Device Control String */
|
|
Karsten Hopp |
51da7c |
+ #define OSC 0x9d /* Operating System Command */
|
|
Karsten Hopp |
51da7c |
+ #define STERM 0x9c /* String Terminator */
|
|
Karsten Hopp |
51da7c |
+
|
|
Karsten Hopp |
51da7c |
/*
|
|
Karsten Hopp |
51da7c |
* Character that separates dir names in a path.
|
|
Karsten Hopp |
51da7c |
* For MS-DOS, WIN32 and OS/2 we use a backslash. A slash mostly works
|
|
Karsten Hopp |
51da7c |
*** ../vim-7.4.769/src/term.c 2015-07-03 13:05:45.833974396 +0200
|
|
Karsten Hopp |
51da7c |
--- src/term.c 2015-07-10 13:53:28.744975532 +0200
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 2364,2370 ****
|
|
Karsten Hopp |
51da7c |
if (p[1] == '[')
|
|
Karsten Hopp |
51da7c |
return CSI;
|
|
Karsten Hopp |
51da7c |
if (p[1] == ']')
|
|
Karsten Hopp |
51da7c |
! return 0x9d;
|
|
Karsten Hopp |
51da7c |
if (p[1] == 'O')
|
|
Karsten Hopp |
51da7c |
return 0x8f;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
--- 2364,2370 ----
|
|
Karsten Hopp |
51da7c |
if (p[1] == '[')
|
|
Karsten Hopp |
51da7c |
return CSI;
|
|
Karsten Hopp |
51da7c |
if (p[1] == ']')
|
|
Karsten Hopp |
51da7c |
! return OSC;
|
|
Karsten Hopp |
51da7c |
if (p[1] == 'O')
|
|
Karsten Hopp |
51da7c |
return 0x8f;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 4261,4278 ****
|
|
Karsten Hopp |
51da7c |
* - Cursor position report: <Esc>[{row};{col}R
|
|
Karsten Hopp |
51da7c |
* The final byte must be 'R'. It is used for checking the
|
|
Karsten Hopp |
51da7c |
* ambiguous-width character state.
|
|
Karsten Hopp |
51da7c |
- *
|
|
Karsten Hopp |
51da7c |
- * - Background color response:
|
|
Karsten Hopp |
51da7c |
- * <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}\007
|
|
Karsten Hopp |
51da7c |
- * Or
|
|
Karsten Hopp |
51da7c |
- * <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}ST
|
|
Karsten Hopp |
51da7c |
- * The final byte must be '\007' or ST(0x9c or ESC\).
|
|
Karsten Hopp |
51da7c |
*/
|
|
Karsten Hopp |
51da7c |
! char_u *argp = tp[0] == CSI ? tp + 1 : tp + 2;
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
! if ((*T_CRV != NUL || *T_U7 != NUL || *T_RBG != NUL)
|
|
Karsten Hopp |
51da7c |
! && ((tp[0] == ESC && tp[1] == '[' && len >= 3)
|
|
Karsten Hopp |
51da7c |
! || (tp[0] == ESC && tp[1] == ']' && len >= 24)
|
|
Karsten Hopp |
51da7c |
|| (tp[0] == CSI && len >= 2))
|
|
Karsten Hopp |
51da7c |
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
--- 4261,4271 ----
|
|
Karsten Hopp |
51da7c |
* - Cursor position report: <Esc>[{row};{col}R
|
|
Karsten Hopp |
51da7c |
* The final byte must be 'R'. It is used for checking the
|
|
Karsten Hopp |
51da7c |
* ambiguous-width character state.
|
|
Karsten Hopp |
51da7c |
*/
|
|
Karsten Hopp |
51da7c |
! char_u *argp = tp[0] == ESC ? tp + 2 : tp + 1;
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
! if ((*T_CRV != NUL || *T_U7 != NUL)
|
|
Karsten Hopp |
51da7c |
! && ((tp[0] == ESC && len >= 3 && tp[1] == '[')
|
|
Karsten Hopp |
51da7c |
|| (tp[0] == CSI && len >= 2))
|
|
Karsten Hopp |
51da7c |
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 4410,4453 ****
|
|
Karsten Hopp |
51da7c |
key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
slen = i + 1;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
! else if (*T_RBG != NUL
|
|
Karsten Hopp |
51da7c |
! && len >= 24 - (tp[0] == CSI)
|
|
Karsten Hopp |
51da7c |
! && len >= 24 - (tp[0] == CSI) + (argp[21] == ESC)
|
|
Karsten Hopp |
51da7c |
! && argp[0] == '1' && argp[1] == '1'
|
|
Karsten Hopp |
51da7c |
! && argp[2] == ';' && argp[3] == 'r' && argp[4] == 'g'
|
|
Karsten Hopp |
51da7c |
! && argp[5] == 'b' && argp[6] == ':'
|
|
Karsten Hopp |
51da7c |
! && argp[11] == '/' && argp[16] == '/'
|
|
Karsten Hopp |
51da7c |
! && (argp[21] == '\007' || argp[21] == STERM
|
|
Karsten Hopp |
51da7c |
! || (argp[21] == ESC && argp[22] == '\\')))
|
|
Karsten Hopp |
51da7c |
! {
|
|
Karsten Hopp |
51da7c |
! LOG_TR("Received RBG");
|
|
Karsten Hopp |
51da7c |
! rbg_status = RBG_GOT;
|
|
Karsten Hopp |
51da7c |
! if (!option_was_set((char_u *)"bg"))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! set_option_value((char_u *)"bg", 0L, (char_u *)(
|
|
Karsten Hopp |
51da7c |
! (3 * '6' < argp[7] + argp[12] + argp[17])
|
|
Karsten Hopp |
51da7c |
! ? "light" : "dark"), 0);
|
|
Karsten Hopp |
51da7c |
! reset_option_was_set((char_u *)"bg");
|
|
Karsten Hopp |
51da7c |
! redraw_asap(CLEAR);
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
! key_name[0] = (int)KS_EXTRA;
|
|
Karsten Hopp |
51da7c |
! key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
! slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
! /* Check for '<Esc>P1+r<hex bytes><Esc>\'. A "0" instead of the
|
|
Karsten Hopp |
51da7c |
! * "1" means an invalid request. */
|
|
Karsten Hopp |
51da7c |
else if (check_for_codes
|
|
Karsten Hopp |
51da7c |
! && ((tp[0] == ESC && tp[1] == 'P' && len >= 2)
|
|
Karsten Hopp |
51da7c |
|| tp[0] == DCS))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! j = 1 + (tp[0] != DCS);
|
|
Karsten Hopp |
51da7c |
! for (i = j; i < len; ++i)
|
|
Karsten Hopp |
51da7c |
! if ((tp[i] == ESC && tp[i + 1] == '\\' && i + 1 < len)
|
|
Karsten Hopp |
51da7c |
|| tp[i] == STERM)
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! if (i - j >= 3 && tp[j + 1] == '+' && tp[j + 2] == 'r')
|
|
Karsten Hopp |
51da7c |
got_code_from_term(tp + j, i);
|
|
Karsten Hopp |
51da7c |
key_name[0] = (int)KS_EXTRA;
|
|
Karsten Hopp |
51da7c |
key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
--- 4403,4482 ----
|
|
Karsten Hopp |
51da7c |
key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
slen = i + 1;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
! }
|
|
Karsten Hopp |
51da7c |
!
|
|
Karsten Hopp |
51da7c |
! /* Check for background color response from the terminal:
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * {lead}11;rgb:{rrrr}/{gggg}/{bbbb}{tail}
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * {lead} can be <Esc>] or OSC
|
|
Karsten Hopp |
51da7c |
! * {tail} can be '\007', <Esc>\ or STERM.
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * Consume any code that starts with "{lead}11;", it's also
|
|
Karsten Hopp |
51da7c |
! * possible that "rgba" is following.
|
|
Karsten Hopp |
51da7c |
! */
|
|
Karsten Hopp |
51da7c |
! else if (*T_RBG != NUL
|
|
Karsten Hopp |
51da7c |
! && ((tp[0] == ESC && len >= 2 && tp[1] == ']')
|
|
Karsten Hopp |
51da7c |
! || tp[0] == OSC))
|
|
Karsten Hopp |
51da7c |
! {
|
|
Karsten Hopp |
51da7c |
! j = 1 + (tp[0] == ESC);
|
|
Karsten Hopp |
51da7c |
! if (len >= j + 3 && (argp[0] != '1'
|
|
Karsten Hopp |
51da7c |
! || argp[1] != '1' || argp[2] != ';'))
|
|
Karsten Hopp |
51da7c |
! i = 0; /* no match */
|
|
Karsten Hopp |
51da7c |
! else
|
|
Karsten Hopp |
51da7c |
! for (i = j; i < len; ++i)
|
|
Karsten Hopp |
51da7c |
! if (tp[i] == '\007' || (tp[0] == OSC ? tp[i] == STERM
|
|
Karsten Hopp |
51da7c |
! : (tp[i] == ESC && i + 1 < len && tp[i + 1] == '\\')))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! if (i - j >= 21 && STRNCMP(tp + j + 3, "rgb:", 4) == 0
|
|
Karsten Hopp |
51da7c |
! && tp[j + 11] == '/' && tp[j + 16] == '/'
|
|
Karsten Hopp |
51da7c |
! && !option_was_set((char_u *)"bg"))
|
|
Karsten Hopp |
51da7c |
! {/* TODO: don't set option when already the right value */
|
|
Karsten Hopp |
51da7c |
! LOG_TR("Received RBG");
|
|
Karsten Hopp |
51da7c |
! rbg_status = RBG_GOT;
|
|
Karsten Hopp |
51da7c |
! set_option_value((char_u *)"bg", 0L, (char_u *)(
|
|
Karsten Hopp |
51da7c |
! (3 * '6' < tp[j+7] + tp[j+12] + tp[j+17])
|
|
Karsten Hopp |
51da7c |
! ? "light" : "dark"), 0);
|
|
Karsten Hopp |
51da7c |
! reset_option_was_set((char_u *)"bg");
|
|
Karsten Hopp |
51da7c |
! redraw_asap(CLEAR);
|
|
Karsten Hopp |
51da7c |
! }
|
|
Karsten Hopp |
51da7c |
!
|
|
Karsten Hopp |
51da7c |
! /* got finished code: consume it */
|
|
Karsten Hopp |
51da7c |
! key_name[0] = (int)KS_EXTRA;
|
|
Karsten Hopp |
51da7c |
! key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
! slen = i + 1 + (tp[i] == ESC);
|
|
Karsten Hopp |
51da7c |
! break;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
! if (i == len)
|
|
Karsten Hopp |
51da7c |
! {
|
|
Karsten Hopp |
51da7c |
! LOG_TR("not enough characters for RB");
|
|
Karsten Hopp |
51da7c |
! return -1;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
! /* Check for key code response from xterm:
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * {lead}{flag}+r<hex bytes><{tail}
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * {lead} can be <Esc>P or DCS
|
|
Karsten Hopp |
51da7c |
! * {flag} can be '0' or '1'
|
|
Karsten Hopp |
51da7c |
! * {tail} can be Esc>\ or STERM
|
|
Karsten Hopp |
51da7c |
! *
|
|
Karsten Hopp |
51da7c |
! * Consume any code that starts with "{lead}.+r".
|
|
Karsten Hopp |
51da7c |
! */
|
|
Karsten Hopp |
51da7c |
else if (check_for_codes
|
|
Karsten Hopp |
51da7c |
! && ((tp[0] == ESC && len >= 2 && tp[1] == 'P')
|
|
Karsten Hopp |
51da7c |
|| tp[0] == DCS))
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! j = 1 + (tp[0] == ESC);
|
|
Karsten Hopp |
51da7c |
! if (len >= j + 3 && (argp[1] != '+' || argp[2] != 'r'))
|
|
Karsten Hopp |
51da7c |
! i = 0; /* no match */
|
|
Karsten Hopp |
51da7c |
! else
|
|
Karsten Hopp |
51da7c |
! for (i = j; i < len; ++i)
|
|
Karsten Hopp |
51da7c |
! if ((tp[i] == ESC && i + 1 < len && tp[i + 1] == '\\')
|
|
Karsten Hopp |
51da7c |
|| tp[i] == STERM)
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
! if (i - j >= 3)
|
|
Karsten Hopp |
51da7c |
got_code_from_term(tp + j, i);
|
|
Karsten Hopp |
51da7c |
key_name[0] = (int)KS_EXTRA;
|
|
Karsten Hopp |
51da7c |
key_name[1] = (int)KE_IGNORE;
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 4457,4464 ****
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
if (i == len)
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
LOG_TR("not enough characters for XT");
|
|
Karsten Hopp |
51da7c |
! return -1; /* not enough characters */
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
--- 4486,4495 ----
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
if (i == len)
|
|
Karsten Hopp |
51da7c |
{
|
|
Karsten Hopp |
51da7c |
+ /* These codes arrive many together, each code can be
|
|
Karsten Hopp |
51da7c |
+ * truncated at any point. */
|
|
Karsten Hopp |
51da7c |
LOG_TR("not enough characters for XT");
|
|
Karsten Hopp |
51da7c |
! return -1;
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
}
|
|
Karsten Hopp |
51da7c |
*** ../vim-7.4.769/src/version.c 2015-07-04 15:05:08.606736259 +0200
|
|
Karsten Hopp |
51da7c |
--- src/version.c 2015-07-10 12:04:22.282011343 +0200
|
|
Karsten Hopp |
51da7c |
***************
|
|
Karsten Hopp |
51da7c |
*** 743,744 ****
|
|
Karsten Hopp |
51da7c |
--- 743,746 ----
|
|
Karsten Hopp |
51da7c |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
51da7c |
+ /**/
|
|
Karsten Hopp |
51da7c |
+ 770,
|
|
Karsten Hopp |
51da7c |
/**/
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
--
|
|
Karsten Hopp |
51da7c |
Some of the well known MS-Windows errors:
|
|
Karsten Hopp |
51da7c |
ETIME Wrong time, wait a little while
|
|
Karsten Hopp |
51da7c |
ECRASH Try again...
|
|
Karsten Hopp |
51da7c |
EDETECT Unable to detect errors
|
|
Karsten Hopp |
51da7c |
EOVER You lost! Play another game?
|
|
Karsten Hopp |
51da7c |
ENOCLUE Eh, what did you want?
|
|
Karsten Hopp |
51da7c |
|
|
Karsten Hopp |
51da7c |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
51da7c |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
51da7c |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
51da7c |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|