Karsten Hopp 86ae31
To: vim_dev@googlegroups.com
Karsten Hopp 86ae31
Subject: Patch 7.4.851
Karsten Hopp 86ae31
Fcc: outbox
Karsten Hopp 86ae31
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 86ae31
Mime-Version: 1.0
Karsten Hopp 86ae31
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 86ae31
Content-Transfer-Encoding: 8bit
Karsten Hopp 86ae31
------------
Karsten Hopp 86ae31
Karsten Hopp 86ae31
Patch 7.4.851
Karsten Hopp 86ae31
Problem:    Saving and restoring the console buffer does not work properly.
Karsten Hopp 86ae31
Solution:   Instead of ReadConsoleOutputA/WriteConsoleOutputA use
Karsten Hopp 86ae31
            CreateConsoleScreenBuffer and SetConsoleActiveScreenBuffer.
Karsten Hopp 86ae31
            (Ken Takata)
Karsten Hopp 86ae31
Files:      src/os_win32.c
Karsten Hopp 86ae31
Karsten Hopp 86ae31
Karsten Hopp 86ae31
*** ../vim-7.4.850/src/os_win32.c	2015-08-04 19:26:59.747310733 +0200
Karsten Hopp 86ae31
--- src/os_win32.c	2015-09-01 20:03:57.428750713 +0200
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2192,2199 ****
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
      BOOL			IsValid;
Karsten Hopp 86ae31
      CONSOLE_SCREEN_BUFFER_INFO	Info;
Karsten Hopp 86ae31
!     PCHAR_INFO			Buffer;
Karsten Hopp 86ae31
!     COORD			BufferSize;
Karsten Hopp 86ae31
  } ConsoleBuffer;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
  /*
Karsten Hopp 86ae31
--- 2192,2198 ----
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
      BOOL			IsValid;
Karsten Hopp 86ae31
      CONSOLE_SCREEN_BUFFER_INFO	Info;
Karsten Hopp 86ae31
!     HANDLE			handle;
Karsten Hopp 86ae31
  } ConsoleBuffer;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
  /*
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2210,2286 ****
Karsten Hopp 86ae31
  SaveConsoleBuffer(
Karsten Hopp 86ae31
      ConsoleBuffer *cb)
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
-     DWORD NumCells;
Karsten Hopp 86ae31
-     COORD BufferCoord;
Karsten Hopp 86ae31
-     SMALL_RECT ReadRegion;
Karsten Hopp 86ae31
-     WORD Y, Y_incr;
Karsten Hopp 86ae31
- 
Karsten Hopp 86ae31
      if (cb == NULL)
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     if (!GetConsoleScreenBufferInfo(g_hConOut, &cb->Info))
Karsten Hopp 86ae31
      {
Karsten Hopp 86ae31
  	cb->IsValid = FALSE;
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
      }
Karsten Hopp 86ae31
      cb->IsValid = TRUE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     /*
Karsten Hopp 86ae31
!      * Allocate a buffer large enough to hold the entire console screen
Karsten Hopp 86ae31
!      * buffer.  If this ConsoleBuffer structure has already been initialized
Karsten Hopp 86ae31
!      * with a buffer of the correct size, then just use that one.
Karsten Hopp 86ae31
!      */
Karsten Hopp 86ae31
!     if (!cb->IsValid || cb->Buffer == NULL ||
Karsten Hopp 86ae31
! 	    cb->BufferSize.X != cb->Info.dwSize.X ||
Karsten Hopp 86ae31
! 	    cb->BufferSize.Y != cb->Info.dwSize.Y)
Karsten Hopp 86ae31
!     {
Karsten Hopp 86ae31
! 	cb->BufferSize.X = cb->Info.dwSize.X;
Karsten Hopp 86ae31
! 	cb->BufferSize.Y = cb->Info.dwSize.Y;
Karsten Hopp 86ae31
! 	NumCells = cb->BufferSize.X * cb->BufferSize.Y;
Karsten Hopp 86ae31
! 	vim_free(cb->Buffer);
Karsten Hopp 86ae31
! 	cb->Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
Karsten Hopp 86ae31
! 	if (cb->Buffer == NULL)
Karsten Hopp 86ae31
! 	    return FALSE;
Karsten Hopp 86ae31
!     }
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      /*
Karsten Hopp 86ae31
!      * We will now copy the console screen buffer into our buffer.
Karsten Hopp 86ae31
!      * ReadConsoleOutput() seems to be limited as far as how much you
Karsten Hopp 86ae31
!      * can read at a time.  Empirically, this number seems to be about
Karsten Hopp 86ae31
!      * 12000 cells (rows * columns).  Start at position (0, 0) and copy
Karsten Hopp 86ae31
!      * in chunks until it is all copied.  The chunks will all have the
Karsten Hopp 86ae31
!      * same horizontal characteristics, so initialize them now.  The
Karsten Hopp 86ae31
!      * height of each chunk will be (12000 / width).
Karsten Hopp 86ae31
       */
Karsten Hopp 86ae31
!     BufferCoord.X = 0;
Karsten Hopp 86ae31
      ReadRegion.Left = 0;
Karsten Hopp 86ae31
!     ReadRegion.Right = cb->Info.dwSize.X - 1;
Karsten Hopp 86ae31
!     Y_incr = 12000 / cb->Info.dwSize.X;
Karsten Hopp 86ae31
!     for (Y = 0; Y < cb->BufferSize.Y; Y += Y_incr)
Karsten Hopp 86ae31
      {
Karsten Hopp 86ae31
! 	/*
Karsten Hopp 86ae31
! 	 * Read into position (0, Y) in our buffer.
Karsten Hopp 86ae31
! 	 */
Karsten Hopp 86ae31
! 	BufferCoord.Y = Y;
Karsten Hopp 86ae31
! 	/*
Karsten Hopp 86ae31
! 	 * Read the region whose top left corner is (0, Y) and whose bottom
Karsten Hopp 86ae31
! 	 * right corner is (width - 1, Y + Y_incr - 1).  This should define
Karsten Hopp 86ae31
! 	 * a region of size width by Y_incr.  Don't worry if this region is
Karsten Hopp 86ae31
! 	 * too large for the remaining buffer; it will be cropped.
Karsten Hopp 86ae31
! 	 */
Karsten Hopp 86ae31
! 	ReadRegion.Top = Y;
Karsten Hopp 86ae31
! 	ReadRegion.Bottom = Y + Y_incr - 1;
Karsten Hopp 86ae31
! 	if (!ReadConsoleOutput(g_hConOut,	/* output handle */
Karsten Hopp 86ae31
! 		cb->Buffer,			/* our buffer */
Karsten Hopp 86ae31
! 		cb->BufferSize,			/* dimensions of our buffer */
Karsten Hopp 86ae31
! 		BufferCoord,			/* offset in our buffer */
Karsten Hopp 86ae31
! 		&ReadRegion))			/* region to save */
Karsten Hopp 86ae31
! 	{
Karsten Hopp 86ae31
! 	    vim_free(cb->Buffer);
Karsten Hopp 86ae31
! 	    cb->Buffer = NULL;
Karsten Hopp 86ae31
! 	    return FALSE;
Karsten Hopp 86ae31
! 	}
Karsten Hopp 86ae31
      }
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      return TRUE;
Karsten Hopp 86ae31
  }
Karsten Hopp 86ae31
--- 2209,2289 ----
Karsten Hopp 86ae31
  SaveConsoleBuffer(
Karsten Hopp 86ae31
      ConsoleBuffer *cb)
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
      if (cb == NULL)
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     if (!GetConsoleScreenBufferInfo(cb->handle, &cb->Info))
Karsten Hopp 86ae31
      {
Karsten Hopp 86ae31
  	cb->IsValid = FALSE;
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
      }
Karsten Hopp 86ae31
      cb->IsValid = TRUE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     return TRUE;
Karsten Hopp 86ae31
! }
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
! /*
Karsten Hopp 86ae31
!  * CopyOldConsoleBuffer()
Karsten Hopp 86ae31
!  * Description:
Karsten Hopp 86ae31
!  *  Copies the old console buffer contents to the current console buffer.
Karsten Hopp 86ae31
!  *  This is used when 'restorescreen' is off.
Karsten Hopp 86ae31
!  * Returns:
Karsten Hopp 86ae31
!  *  TRUE on success
Karsten Hopp 86ae31
!  */
Karsten Hopp 86ae31
!     static BOOL
Karsten Hopp 86ae31
! CopyOldConsoleBuffer(
Karsten Hopp 86ae31
!     ConsoleBuffer   *cb,
Karsten Hopp 86ae31
!     HANDLE	    hConOld)
Karsten Hopp 86ae31
! {
Karsten Hopp 86ae31
!     COORD		    BufferCoord;
Karsten Hopp 86ae31
!     COORD		    BufferSize;
Karsten Hopp 86ae31
!     PCHAR_INFO		    Buffer;
Karsten Hopp 86ae31
!     DWORD		    NumCells;
Karsten Hopp 86ae31
!     SMALL_RECT		    ReadRegion;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      /*
Karsten Hopp 86ae31
!      * Before copying the buffer contents, clear the current buffer, and
Karsten Hopp 86ae31
!      * restore the window information.  Doing this now prevents old buffer
Karsten Hopp 86ae31
!      * contents from "flashing" onto the screen.
Karsten Hopp 86ae31
       */
Karsten Hopp 86ae31
!     ClearConsoleBuffer(cb->Info.wAttributes);
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     /* We only need to copy the window area, not whole buffer. */
Karsten Hopp 86ae31
!     BufferSize.X = cb->Info.srWindow.Right - cb->Info.srWindow.Left + 1;
Karsten Hopp 86ae31
!     BufferSize.Y = cb->Info.srWindow.Bottom - cb->Info.srWindow.Top + 1;
Karsten Hopp 86ae31
      ReadRegion.Left = 0;
Karsten Hopp 86ae31
!     ReadRegion.Right = BufferSize.X - 1;
Karsten Hopp 86ae31
!     ReadRegion.Top = 0;
Karsten Hopp 86ae31
!     ReadRegion.Bottom = BufferSize.Y - 1;
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     NumCells = BufferSize.X * BufferSize.Y;
Karsten Hopp 86ae31
!     Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
Karsten Hopp 86ae31
!     if (Buffer == NULL)
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     BufferCoord.X = 0;
Karsten Hopp 86ae31
!     BufferCoord.Y = 0;
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     if (!ReadConsoleOutputW(hConOld,	    /* output handle */
Karsten Hopp 86ae31
! 		Buffer,			    /* our buffer */
Karsten Hopp 86ae31
! 		BufferSize,		    /* dimensions of our buffer */
Karsten Hopp 86ae31
! 		BufferCoord,		    /* offset in our buffer */
Karsten Hopp 86ae31
! 		&ReadRegion))		    /* region to save */
Karsten Hopp 86ae31
      {
Karsten Hopp 86ae31
! 	vim_free(Buffer);
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
!     }
Karsten Hopp 86ae31
!     if (!WriteConsoleOutputW(g_hConOut,     /* output handle */
Karsten Hopp 86ae31
! 		Buffer,			    /* our buffer */
Karsten Hopp 86ae31
! 		BufferSize,		    /* dimensions of our buffer */
Karsten Hopp 86ae31
! 		BufferCoord,		    /* offset in our buffer */
Karsten Hopp 86ae31
! 		&ReadRegion))		    /* region to restore */
Karsten Hopp 86ae31
!     {
Karsten Hopp 86ae31
! 	vim_free(Buffer);
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
      }
Karsten Hopp 86ae31
+     vim_free(Buffer);
Karsten Hopp 86ae31
+     SetConsoleWindowInfo(g_hConOut, TRUE, &ReadRegion);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      return TRUE;
Karsten Hopp 86ae31
  }
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2299,2365 ****
Karsten Hopp 86ae31
      ConsoleBuffer   *cb,
Karsten Hopp 86ae31
      BOOL	    RestoreScreen)
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
!     COORD BufferCoord;
Karsten Hopp 86ae31
!     SMALL_RECT WriteRegion;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      if (cb == NULL || !cb->IsValid)
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     /*
Karsten Hopp 86ae31
!      * Before restoring the buffer contents, clear the current buffer, and
Karsten Hopp 86ae31
!      * restore the cursor position and window information.  Doing this now
Karsten Hopp 86ae31
!      * prevents old buffer contents from "flashing" onto the screen.
Karsten Hopp 86ae31
!      */
Karsten Hopp 86ae31
!     if (RestoreScreen)
Karsten Hopp 86ae31
! 	ClearConsoleBuffer(cb->Info.wAttributes);
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     FitConsoleWindow(cb->Info.dwSize, TRUE);
Karsten Hopp 86ae31
!     if (!SetConsoleScreenBufferSize(g_hConOut, cb->Info.dwSize))
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
!     if (!SetConsoleTextAttribute(g_hConOut, cb->Info.wAttributes))
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     if (!RestoreScreen)
Karsten Hopp 86ae31
!     {
Karsten Hopp 86ae31
! 	/*
Karsten Hopp 86ae31
! 	 * No need to restore the screen buffer contents, so we're done.
Karsten Hopp 86ae31
! 	 */
Karsten Hopp 86ae31
! 	return TRUE;
Karsten Hopp 86ae31
!     }
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     if (!SetConsoleCursorPosition(g_hConOut, cb->Info.dwCursorPosition))
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
!     if (!SetConsoleWindowInfo(g_hConOut, TRUE, &cb->Info.srWindow))
Karsten Hopp 86ae31
! 	return FALSE;
Karsten Hopp 86ae31
! 
Karsten Hopp 86ae31
!     /*
Karsten Hopp 86ae31
!      * Restore the screen buffer contents.
Karsten Hopp 86ae31
!      */
Karsten Hopp 86ae31
!     if (cb->Buffer != NULL)
Karsten Hopp 86ae31
!     {
Karsten Hopp 86ae31
! 	BufferCoord.X = 0;
Karsten Hopp 86ae31
! 	BufferCoord.Y = 0;
Karsten Hopp 86ae31
! 	WriteRegion.Left = 0;
Karsten Hopp 86ae31
! 	WriteRegion.Top = 0;
Karsten Hopp 86ae31
! 	WriteRegion.Right = cb->Info.dwSize.X - 1;
Karsten Hopp 86ae31
! 	WriteRegion.Bottom = cb->Info.dwSize.Y - 1;
Karsten Hopp 86ae31
! 	if (!WriteConsoleOutput(g_hConOut,	/* output handle */
Karsten Hopp 86ae31
! 		cb->Buffer,			/* our buffer */
Karsten Hopp 86ae31
! 		cb->BufferSize,			/* dimensions of our buffer */
Karsten Hopp 86ae31
! 		BufferCoord,			/* offset in our buffer */
Karsten Hopp 86ae31
! 		&WriteRegion))			/* region to restore */
Karsten Hopp 86ae31
! 	{
Karsten Hopp 86ae31
! 	    return FALSE;
Karsten Hopp 86ae31
! 	}
Karsten Hopp 86ae31
!     }
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      return TRUE;
Karsten Hopp 86ae31
  }
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
- #define FEAT_RESTORE_ORIG_SCREEN
Karsten Hopp 86ae31
- #ifdef FEAT_RESTORE_ORIG_SCREEN
Karsten Hopp 86ae31
- static ConsoleBuffer g_cbOrig = { 0 };
Karsten Hopp 86ae31
- #endif
Karsten Hopp 86ae31
  static ConsoleBuffer g_cbNonTermcap = { 0 };
Karsten Hopp 86ae31
  static ConsoleBuffer g_cbTermcap = { 0 };
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
--- 2302,2321 ----
Karsten Hopp 86ae31
      ConsoleBuffer   *cb,
Karsten Hopp 86ae31
      BOOL	    RestoreScreen)
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
!     HANDLE hConOld;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      if (cb == NULL || !cb->IsValid)
Karsten Hopp 86ae31
  	return FALSE;
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
!     hConOld = g_hConOut;
Karsten Hopp 86ae31
!     g_hConOut = cb->handle;
Karsten Hopp 86ae31
!     if (!RestoreScreen && exiting)
Karsten Hopp 86ae31
! 	CopyOldConsoleBuffer(cb, hConOld);
Karsten Hopp 86ae31
!     SetConsoleActiveScreenBuffer(g_hConOut);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      return TRUE;
Karsten Hopp 86ae31
  }
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
  static ConsoleBuffer g_cbNonTermcap = { 0 };
Karsten Hopp 86ae31
  static ConsoleBuffer g_cbTermcap = { 0 };
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2498,2506 ****
Karsten Hopp 86ae31
      void
Karsten Hopp 86ae31
  mch_init(void)
Karsten Hopp 86ae31
  {
Karsten Hopp 86ae31
- #ifndef FEAT_RESTORE_ORIG_SCREEN
Karsten Hopp 86ae31
-     CONSOLE_SCREEN_BUFFER_INFO csbi;
Karsten Hopp 86ae31
- #endif
Karsten Hopp 86ae31
  #ifndef __MINGW32__
Karsten Hopp 86ae31
      extern int _fmode;
Karsten Hopp 86ae31
  #endif
Karsten Hopp 86ae31
--- 2454,2459 ----
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2521,2536 ****
Karsten Hopp 86ae31
      else
Karsten Hopp 86ae31
  	create_conin();
Karsten Hopp 86ae31
      g_hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
- #ifdef FEAT_RESTORE_ORIG_SCREEN
Karsten Hopp 86ae31
-     /* Save the initial console buffer for later restoration */
Karsten Hopp 86ae31
-     SaveConsoleBuffer(&g_cbOrig);
Karsten Hopp 86ae31
-     g_attrCurrent = g_attrDefault = g_cbOrig.Info.wAttributes;
Karsten Hopp 86ae31
- #else
Karsten Hopp 86ae31
      /* Get current text attributes */
Karsten Hopp 86ae31
!     GetConsoleScreenBufferInfo(g_hConOut, &csbi);
Karsten Hopp 86ae31
!     g_attrCurrent = g_attrDefault = csbi.wAttributes;
Karsten Hopp 86ae31
! #endif
Karsten Hopp 86ae31
      if (cterm_normal_fg_color == 0)
Karsten Hopp 86ae31
  	cterm_normal_fg_color = (g_attrCurrent & 0xf) + 1;
Karsten Hopp 86ae31
      if (cterm_normal_bg_color == 0)
Karsten Hopp 86ae31
--- 2474,2487 ----
Karsten Hopp 86ae31
      else
Karsten Hopp 86ae31
  	create_conin();
Karsten Hopp 86ae31
      g_hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
Karsten Hopp 86ae31
+     g_cbNonTermcap.handle = g_hConOut;
Karsten Hopp 86ae31
+     g_cbTermcap.handle = CreateConsoleScreenBuffer(
Karsten Hopp 86ae31
+ 	    GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
Karsten Hopp 86ae31
+ 	    NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
      /* Get current text attributes */
Karsten Hopp 86ae31
!     SaveConsoleBuffer(&g_cbNonTermcap);
Karsten Hopp 86ae31
!     g_attrCurrent = g_attrDefault = g_cbNonTermcap.Info.wAttributes;
Karsten Hopp 86ae31
      if (cterm_normal_fg_color == 0)
Karsten Hopp 86ae31
  	cterm_normal_fg_color = (g_attrCurrent & 0xf) + 1;
Karsten Hopp 86ae31
      if (cterm_normal_bg_color == 0)
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 2630,2635 ****
Karsten Hopp 86ae31
--- 2581,2588 ----
Karsten Hopp 86ae31
      SetConsoleMode(g_hConIn,  g_cmodein);
Karsten Hopp 86ae31
      SetConsoleMode(g_hConOut, g_cmodeout);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
+     CloseHandle(g_cbTermcap.handle);
Karsten Hopp 86ae31
+ 
Karsten Hopp 86ae31
  #ifdef DYNAMIC_GETTEXT
Karsten Hopp 86ae31
      dyn_libintl_end();
Karsten Hopp 86ae31
  #endif
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 5002,5007 ****
Karsten Hopp 86ae31
--- 4955,4962 ----
Karsten Hopp 86ae31
  	 * screen buffer, and resize the buffer to match the current window
Karsten Hopp 86ae31
  	 * size.  We will use this as the size of our editing environment.
Karsten Hopp 86ae31
  	 */
Karsten Hopp 86ae31
+ 	g_hConOut = g_cbTermcap.handle;
Karsten Hopp 86ae31
+ 	SetConsoleActiveScreenBuffer(g_hConOut);
Karsten Hopp 86ae31
  	ClearConsoleBuffer(g_attrCurrent);
Karsten Hopp 86ae31
  	ResizeConBufAndWindow(g_hConOut, Columns, Rows);
Karsten Hopp 86ae31
      }
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 5045,5055 ****
Karsten Hopp 86ae31
      cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
Karsten Hopp 86ae31
      SetConsoleMode(g_hConIn, cmodein);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
- #ifdef FEAT_RESTORE_ORIG_SCREEN
Karsten Hopp 86ae31
-     cb = exiting ? &g_cbOrig : &g_cbNonTermcap;
Karsten Hopp 86ae31
- #else
Karsten Hopp 86ae31
      cb = &g_cbNonTermcap;
Karsten Hopp 86ae31
- #endif
Karsten Hopp 86ae31
      RestoreConsoleBuffer(cb, p_rs);
Karsten Hopp 86ae31
      SetConsoleCursorInfo(g_hConOut, &g_cci);
Karsten Hopp 86ae31
  
Karsten Hopp 86ae31
--- 5000,5006 ----
Karsten Hopp 86ae31
*** ../vim-7.4.850/src/version.c	2015-09-01 19:50:05.697404798 +0200
Karsten Hopp 86ae31
--- src/version.c	2015-09-01 20:22:33.065197395 +0200
Karsten Hopp 86ae31
***************
Karsten Hopp 86ae31
*** 743,744 ****
Karsten Hopp 86ae31
--- 743,746 ----
Karsten Hopp 86ae31
  {   /* Add new patch number below this line */
Karsten Hopp 86ae31
+ /**/
Karsten Hopp 86ae31
+     851,
Karsten Hopp 86ae31
  /**/
Karsten Hopp 86ae31
Karsten Hopp 86ae31
-- 
Karsten Hopp 86ae31
FATAL ERROR! SYSTEM HALTED! - Press any key to continue doing nothing.
Karsten Hopp 86ae31
Karsten Hopp 86ae31
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 86ae31
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 86ae31
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 86ae31
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///