Patch 8.2.4777 (after 8.2.4775)
Problem:    Screendump tests fail because of a redraw.
Solution:   Do not output t_8u before receiving termresponse.  Redraw only
            when t_8u is not reset and termresponse is received.
Files:      src/term.c


*** ../vim-8.2.4776/src/term.c  2022-04-17 17:34:37.660960579 +0100
--- src/term.c  2022-04-17 19:11:47.407000178 +0100
***************
*** 165,170 ****
--- 165,178 ----
      &winpos_status,
      NULL
  };
+ 
+ // The t_8u code may default to a value but get reset when the term response 
is
+ // received.  To avoid redrawing too often, only redraw when t_8u is not reset
+ // and it was supposed to be written.
+ // FALSE -> don't output t_8u yet
+ // MAYBE -> tried outputing t_8u while FALSE
+ // OK    -> can write t_8u
+ int write_t_8u_state = FALSE;
  # endif
  
  /*
***************
*** 2104,2109 ****
--- 2112,2118 ----
  #ifdef FEAT_TERMRESPONSE
      LOG_TR(("setting crv_status to STATUS_GET"));
      crv_status.tr_progress = STATUS_GET;      // Get terminal version later
+     write_t_8u_state = FALSE;
  #endif
  
      /*
***************
*** 3049,3054 ****
--- 3058,3065 ----
  #define MAX_COLOR_STR_LEN 100
      char      buf[MAX_COLOR_STR_LEN];
  
+     if (*s == NUL)
+       return;
      vim_snprintf(buf, MAX_COLOR_STR_LEN,
                                  (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
  #ifdef FEAT_VTP
***************
*** 3078,3084 ****
      void
  term_ul_rgb_color(guicolor_T rgb)
  {
!     term_rgb_color(T_8U, rgb);
  }
  #endif
  
--- 3089,3100 ----
      void
  term_ul_rgb_color(guicolor_T rgb)
  {
! # ifdef FEAT_TERMRESPONSE
!     if (write_t_8u_state != OK)
!       write_t_8u_state = MAYBE;
!     else
! # endif
!       term_rgb_color(T_8U, rgb);
  }
  #endif
  
***************
*** 4814,4821 ****
        {
            set_string_option_direct((char_u *)"t_8u", -1, (char_u *)"",
                                                                  OPT_FREE, 0);
-           redraw_later(CLEAR);
        }
  
        // Only set 'ttymouse' automatically if it was not set
        // by the user already.
--- 4830,4840 ----
        {
            set_string_option_direct((char_u *)"t_8u", -1, (char_u *)"",
                                                                  OPT_FREE, 0);
        }
+       if (*T_8U != NUL && write_t_8u_state == MAYBE)
+           // Did skip writing t_8u, a complete redraw is needed.
+           redraw_later_clear();
+       write_t_8u_state = OK;  // can otuput t_8u now
  
        // Only set 'ttymouse' automatically if it was not set
        // by the user already.
*** ../vim-8.2.4776/src/version.c       2022-04-17 18:27:45.556029572 +0100
--- src/version.c       2022-04-17 18:49:51.387934113 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4777,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
12. You turn off your Wifi and get this awful empty feeling, like you just
    pulled the plug on a loved one.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220417182102.637DA1C03BA%40moolenaar.net.

Raspunde prin e-mail lui