diff src/term.c @ 16936:73e6ed2f69a2 v8.1.1469

patch 8.1.1469: no test for checking the cursor style response commit https://github.com/vim/vim/commit/66761db11d321d60d4692947e90de9030301f6ee Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 5 22:07:51 2019 +0200 patch 8.1.1469: no test for checking the cursor style response Problem: No test for checking the cursor style response. Solution: Add a simple test. Also include the missing part of 8.1.1464.
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Jun 2019 22:15:05 +0200
parents bcc25f1a264d
children 1c264ca8f2e8
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -4015,7 +4015,8 @@ term_cursor_color(char_u *color)
 blink_state_is_inverted()
 {
 #ifdef FEAT_TERMRESPONSE
-    return rbm_status.tr_progress == STATUS_GOT && rcs_status.tr_progress == STATUS_GOT
+    return rbm_status.tr_progress == STATUS_GOT
+	&& rcs_status.tr_progress == STATUS_GOT
 		&& initial_cursor_blink != initial_cursor_shape_blink;
 #else
     return FALSE;
@@ -5062,7 +5063,7 @@ check_termcode(
 	     * {lead}1$r<digit> q{tail}
 	     *
 	     * {lead} can be <Esc>P or DCS
-	     * {tail} can be Esc>\ or STERM
+	     * {tail} can be <Esc>\ or STERM
 	     *
 	     * Consume any code that starts with "{lead}.+r" or "{lead}.$r".
 	     */
@@ -5072,29 +5073,29 @@ check_termcode(
 	    {
 		j = 1 + (tp[0] == ESC);
 		if (len < j + 3)
-		    i = len; /* need more chars */
+		    i = len; // need more chars
 		else if ((argp[1] != '+' && argp[1] != '$') || argp[2] != 'r')
-		  i = 0; /* no match */
+		    i = 0; // no match
 		else if (argp[1] == '+')
-		  /* key code response */
-		  for (i = j; i < len; ++i)
-		  {
-		    if ((tp[i] == ESC && i + 1 < len && tp[i + 1] == '\\')
-			    || tp[i] == STERM)
+		    // key code response
+		    for (i = j; i < len; ++i)
 		    {
-			if (i - j >= 3)
-			    got_code_from_term(tp + j, i);
-			key_name[0] = (int)KS_EXTRA;
-			key_name[1] = (int)KE_IGNORE;
-			slen = i + 1 + (tp[i] == ESC);
-			break;
+			if ((tp[i] == ESC && i + 1 < len && tp[i + 1] == '\\')
+				|| tp[i] == STERM)
+			{
+			    if (i - j >= 3)
+				got_code_from_term(tp + j, i);
+			    key_name[0] = (int)KS_EXTRA;
+			    key_name[1] = (int)KE_IGNORE;
+			    slen = i + 1 + (tp[i] == ESC);
+			    break;
+			}
 		    }
-		  }
 		else
 		{
-		    /* Probably the cursor shape response.  Make sure that "i"
-		     * is equal to "len" when there are not sufficient
-		     * characters. */
+		    // Probably the cursor shape response.  Make sure that "i"
+		    // is equal to "len" when there are not sufficient
+		    // characters.
 		    for (i = j + 3; i < len; ++i)
 		    {
 			if (i - j == 3 && !isdigit(tp[i]))
@@ -5110,13 +5111,13 @@ check_termcode(
 			{
 			    int number = argp[3] - '0';
 
-			    /* 0, 1 = block blink, 2 = block
-			     * 3 = underline blink, 4 = underline
-			     * 5 = vertical bar blink, 6 = vertical bar */
+			    // 0, 1 = block blink, 2 = block
+			    // 3 = underline blink, 4 = underline
+			    // 5 = vertical bar blink, 6 = vertical bar
 			    number = number == 0 ? 1 : number;
 			    initial_cursor_shape = (number + 1) / 2;
-			    /* The blink flag is actually inverted, compared to
-			     * the value set with T_SH. */
+			    // The blink flag is actually inverted, compared to
+			    // the value set with T_SH.
 			    initial_cursor_shape_blink =
 						   (number & 1) ? FALSE : TRUE;
 			    rcs_status.tr_progress = STATUS_GOT;