Patch 9.0.1235
Problem:    MS-Windows console: not flushing termguicolors.
Solution:   Flush termguicolors. (Christopher Plewright, closes #11871)
Files:      src/os_win32.c, src/proto/os_win32.pro, src/term.c


*** ../vim-9.0.1234/src/os_win32.c      2023-01-22 18:58:26.730874051 +0000
--- src/os_win32.c      2023-01-23 12:32:34.694736662 +0000
***************
*** 6776,6795 ****
      WORD    attrFlash = ~g_attrCurrent & 0xff;
  
      DWORD   dwDummy;
!     LPWORD  oldattrs = ALLOC_MULT(WORD, Rows * Columns);
  
!     if (oldattrs == NULL)
!       return;
!     ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
                               coordOrigin, &dwDummy);
      FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
                               coordOrigin, &dwDummy);
  
      Sleep(15);            // wait for 15 msec
!     if (!vtp_working)
        WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
                                coordOrigin, &dwDummy);
!     vim_free(oldattrs);
  }
  
  
--- 6776,6805 ----
      WORD    attrFlash = ~g_attrCurrent & 0xff;
  
      DWORD   dwDummy;
!     LPWORD  oldattrs = NULL;
  
! # ifdef FEAT_TERMGUICOLORS
!     if (!(p_tgc || t_colors >= 256))
! # endif
!     {
!       oldattrs = ALLOC_MULT(WORD, Rows * Columns);
!       if (oldattrs == NULL)
!           return;
!       ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
                               coordOrigin, &dwDummy);
+     }
+ 
      FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
                               coordOrigin, &dwDummy);
  
      Sleep(15);            // wait for 15 msec
! 
!     if (oldattrs != NULL)
!     {
        WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
                                coordOrigin, &dwDummy);
!       vim_free(oldattrs);
!     }
  }
  
  
***************
*** 8665,8676 ****
      wt_working = mch_getenv("WT_SESSION") != NULL;
  }
  
-     int
- use_wt(void)
- {
-     return USE_WT;
- }
- 
  # ifdef FEAT_TERMGUICOLORS
      static int
  ctermtoxterm(
--- 8675,8680 ----
*** ../vim-9.0.1234/src/proto/os_win32.pro      2023-01-22 18:58:26.730874051 
+0000
--- src/proto/os_win32.pro      2023-01-23 12:29:44.438830348 +0000
***************
*** 73,79 ****
  void fix_arg_enc(void);
  int mch_setenv(char *var, char *value, int x);
  int vtp_printf(char *format, ...);
- int use_wt(void);
  void get_default_console_color(int *cterm_fg, int *cterm_bg, guicolor_T 
*gui_fg, guicolor_T *gui_bg);
  void control_console_color_rgb(void);
  int use_vtp(void);
--- 73,78 ----
*** ../vim-9.0.1234/src/term.c  2023-01-22 18:58:26.730874051 +0000
--- src/term.c  2023-01-23 12:28:00.642894421 +0000
***************
*** 3222,3228 ****
      vim_snprintf(buf, MAX_COLOR_STR_LEN,
                                  (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
  #ifdef FEAT_VTP
!     if (use_wt())
      {
        out_flush();
        buf[1] = '[';
--- 3222,3228 ----
      vim_snprintf(buf, MAX_COLOR_STR_LEN,
                                  (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
  #ifdef FEAT_VTP
!     if (use_vtp() && (p_tgc || t_colors >= 256))
      {
        out_flush();
        buf[1] = '[';
*** ../vim-9.0.1234/src/version.c       2023-01-22 21:14:32.621863614 +0000
--- src/version.c       2023-01-23 12:30:06.530817450 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1235,
  /**/

-- 
Bumper sticker: Honk if you love peace and quiet.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230123123450.EE4D81C0F93%40moolenaar.net.

Raspunde prin e-mail lui