Re: Patch 9.0.1086

2022-12-23 Fir de Conversatie John Marriott




On 23-Dec-2022 09:37, Christopher Plewright wrote:

On 23-Dec-2022 00:44, Bram Moolenaar wrote:


Thanks again John.


No worries 

--
--
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/83fb989c-3f53-3278-2d54-50974a8e6b72%40internode.on.net.


RE: Patch 9.0.1086

2022-12-22 Fir de Conversatie Christopher Plewright
> On 23-Dec-2022 00:44, Bram Moolenaar wrote:
> > Patch 9.0.1086
> > Problem:Display wrong in Windows terminal after exiting Vim.
> > Solution:   Apply screen restore fix for Windows 11 also to Windows 10
> builds.
> >  (Christopher Plewright, closes #11713, closes #11706)
> > Files:  src/os_win32.c
> >
> >
> After this patch msys2 (clang 15.0.5 x64) gives this warning:
> 
> clang -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -
> DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -
> D__USE_MINGW_ANSI_STDIO -pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -
> DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD os_win32.c -o gobjx86-64/os_win32.o
> os_win32.c:260:13: warning: unused variable 'use_alternate_screen_buffer' [-
> Wunused-variable] static BOOL use_alternate_screen_buffer = FALSE;
>      ^
> 1 warning generated.
> 
> 
> The attached patch tries to fix it.

Thanks again John.

-- 
-- 
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/SYBP282MB269506E23C9F1EE4D7082240DBE89%40SYBP282MB2695.AUSP282.PROD.OUTLOOK.COM.


Re: Patch 9.0.1086

2022-12-22 Fir de Conversatie Bram Moolenaar


John Marriott wrote:

> On 23-Dec-2022 00:44, Bram Moolenaar wrote:
> > Patch 9.0.1086
> > Problem:Display wrong in Windows terminal after exiting Vim.
> > Solution:   Apply screen restore fix for Windows 11 also to Windows 10 bu=
> ilds.
> >  (Christopher Plewright, closes #11713, closes #11706)
> > Files:  src/os_win32.c
> >
> >
> After this patch msys2 (clang 15.0.5 x64) gives this warning:
> 
> clang -c -I. -Iproto -DWIN32 -DWINVER=3D0x0603 -D_WIN32_WINNT=3D0x0603=20
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO=20
> -pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -DFEAT_GUI_MSWIN=20
> -DFEAT_CLIPBOARD os_win32.c -o gobjx86-64/os_win32.o
> os_win32.c:260:13: warning: unused variable=20
> 'use_alternate_screen_buffer' [-Wunused-variable]
> static BOOL use_alternate_screen_buffer =3D FALSE;
>  =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^
> 1 warning generated.
> 
> 
> The attached patch tries to fix it.

Thanks!

-- 
ARTHUR:A scratch?  Your arm's off!
BLACK KNIGHT:  No, it isn't.
ARTHUR:Well, what's that then?
BLACK KNIGHT:  I've had worse.
  The Quest for the Holy Grail (Monty Python)

 /// 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/2022110823.54BCC1C0AA3%40moolenaar.net.


Re: Patch 9.0.1086

2022-12-22 Fir de Conversatie John Marriott


On 23-Dec-2022 00:44, Bram Moolenaar wrote:

Patch 9.0.1086
Problem:Display wrong in Windows terminal after exiting Vim.
Solution:   Apply screen restore fix for Windows 11 also to Windows 10 builds.
 (Christopher Plewright, closes #11713, closes #11706)
Files:  src/os_win32.c



After this patch msys2 (clang 15.0.5 x64) gives this warning:

clang -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
-pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -DFEAT_GUI_MSWIN 
-DFEAT_CLIPBOARD os_win32.c -o gobjx86-64/os_win32.o
os_win32.c:260:13: warning: unused variable 
'use_alternate_screen_buffer' [-Wunused-variable]

static BOOL use_alternate_screen_buffer = FALSE;
    ^
1 warning generated.


The attached patch tries to fix it.

Cheers
John

--
--
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/e43a469c-b6f3-e00b-c708-8bf0613ec18b%40internode.on.net.
--- os_win32.c.orig 2022-12-23 05:25:08.900346500 +1100
+++ os_win32.c  2022-12-23 05:33:23.155461500 +1100
@@ -257,7 +257,9 @@
 
 static BOOL win8_or_later = FALSE;
 static BOOL win10_22H2_or_later = FALSE;
+#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)
 static BOOL use_alternate_screen_buffer = FALSE;
+#endif
 
 /*
  * Get version number including build number


Patch 9.0.1086

2022-12-22 Fir de Conversatie Bram Moolenaar


Patch 9.0.1086
Problem:Display wrong in Windows terminal after exiting Vim.
Solution:   Apply screen restore fix for Windows 11 also to Windows 10 builds.
(Christopher Plewright, closes #11713, closes #11706)
Files:  src/os_win32.c


*** ../vim-9.0.1085/src/os_win32.c  2022-12-20 20:47:23.820385483 +
--- src/os_win32.c  2022-12-22 13:37:38.296270237 +
***
*** 256,262 
  static char_u *exe_path = NULL;
  
  static BOOL win8_or_later = FALSE;
! static BOOL win11_or_later = FALSE;
  
  /*
   * Get version number including build number
--- 256,263 
  static char_u *exe_path = NULL;
  
  static BOOL win8_or_later = FALSE;
! static BOOL win10_22H2_or_later = FALSE;
! static BOOL use_alternate_screen_buffer = FALSE;
  
  /*
   * Get version number including build number
***
*** 919,927 
|| ovi.dwMajorVersion > 6)
win8_or_later = TRUE;
  
!   if ((ovi.dwMajorVersion == 10 && ovi.dwBuildNumber >= 22000)
|| ovi.dwMajorVersion > 10)
!   win11_or_later = TRUE;
  
  #ifdef HAVE_ACL
// Enable privilege for getting or setting SACLs.
--- 920,928 
|| ovi.dwMajorVersion > 6)
win8_or_later = TRUE;
  
!   if ((ovi.dwMajorVersion == 10 && ovi.dwBuildNumber >= 19045)
|| ovi.dwMajorVersion > 10)
!   win10_22H2_or_later = TRUE;
  
  #ifdef HAVE_ACL
// Enable privilege for getting or setting SACLs.
***
*** 3040,3046 
  
  // VTP uses alternate screen buffer.
  // No need to save buffer contents for restoration.
! if (win11_or_later && vtp_working)
return TRUE;
  
  /*
--- 3041,3047 
  
  // VTP uses alternate screen buffer.
  // No need to save buffer contents for restoration.
! if (use_alternate_screen_buffer)
return TRUE;
  
  /*
***
*** 3138,3144 
  
  // VTP uses alternate screen buffer.
  // No need to restore buffer contents.
! if (win11_or_later && vtp_working)
return TRUE;
  
  if (cb == NULL || !cb->IsValid)
--- 3139,3145 
  
  // VTP uses alternate screen buffer.
  // No need to restore buffer contents.
! if (use_alternate_screen_buffer)
return TRUE;
  
  if (cb == NULL || !cb->IsValid)
***
*** 6106,6112 
  
  // VTP uses alternate screen buffer.
  // Switch to a new alternate screen buffer.
! if (win11_or_later && p_rs && vtp_working)
vtp_printf("\033[?1049h");
  
  SaveConsoleBuffer(_cbNonTermcap);
--- 6107,6114 
  
  // VTP uses alternate screen buffer.
  // Switch to a new alternate screen buffer.
! // But, not if running in a nested terminal
! if (use_alternate_screen_buffer)
vtp_printf("\033[?1049h");
  
  SaveConsoleBuffer(_cbNonTermcap);
***
*** 6189,6195 
  
  // VTP uses alternate screen buffer.
  // Switch back to main screen buffer.
! if (exiting && win11_or_later && p_rs && vtp_working)
vtp_printf("\033[?1049l");
  
  if (!USE_WT && (p_rs || exiting))
--- 6191,6197 
  
  // VTP uses alternate screen buffer.
  // Switch back to main screen buffer.
! if (exiting && use_alternate_screen_buffer)
vtp_printf("\033[?1049l");
  
  if (!USE_WT && (p_rs || exiting))
***
*** 8392,8398 
default_console_color_fg = fg;
  }
  # endif
! 
  set_console_color_rgb();
  }
  
--- 8394,8401 
default_console_color_fg = fg;
  }
  # endif
! use_alternate_screen_buffer = win10_22H2_or_later && p_rs && vtp_working
!   && !mch_getenv("VIM_TERMINAL");
  set_console_color_rgb();
  }
  
*** ../vim-9.0.1085/src/version.c   2022-12-20 20:47:23.820385483 +
--- src/version.c   2022-12-22 13:42:17.955851316 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1086,
  /**/

-- 
-- 
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/20221222134454.F0F541C057C%40moolenaar.net.