summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0250
blob: 50c7f4be1efcb83becfaa7450644918e4220f047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0250
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0250
Problem:    MS-Windows using VTP: windows size change incorrect.
Solution:   Call SetConsoleScreenBufferSize() first. (Nobuhiro Takasaki,
            closes #3164)
Files:	    src/os_win32.c


*** ../vim-8.1.0249/src/os_win32.c	2018-06-19 19:59:15.244704285 +0200
--- src/os_win32.c	2018-08-07 20:45:29.601418126 +0200
***************
*** 3967,3972 ****
--- 3967,4014 ----
  }
  
  /*
+  * Resize console buffer to 'COORD'
+  */
+     static void
+ ResizeConBuf(
+     HANDLE  hConsole,
+     COORD   coordScreen)
+ {
+     if (!SetConsoleScreenBufferSize(hConsole, coordScreen))
+     {
+ #ifdef MCH_WRITE_DUMP
+ 	if (fdDump)
+ 	{
+ 	    fprintf(fdDump, "SetConsoleScreenBufferSize failed: %lx\n",
+ 		    GetLastError());
+ 	    fflush(fdDump);
+ 	}
+ #endif
+     }
+ }
+ 
+ /*
+  * Resize console window size to 'srWindowRect'
+  */
+     static void
+ ResizeWindow(
+     HANDLE     hConsole,
+     SMALL_RECT srWindowRect)
+ {
+     if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect))
+     {
+ #ifdef MCH_WRITE_DUMP
+ 	if (fdDump)
+ 	{
+ 	    fprintf(fdDump, "SetConsoleWindowInfo failed: %lx\n",
+ 		    GetLastError());
+ 	    fflush(fdDump);
+ 	}
+ #endif
+     }
+ }
+ 
+ /*
   * Set a console window to `xSize' * `ySize'
   */
      static void
***************
*** 4019,4050 ****
  	}
      }
  
!     if (!SetConsoleWindowInfo(g_hConOut, TRUE, &srWindowRect))
!     {
! #ifdef MCH_WRITE_DUMP
! 	if (fdDump)
! 	{
! 	    fprintf(fdDump, "SetConsoleWindowInfo failed: %lx\n",
! 		    GetLastError());
! 	    fflush(fdDump);
! 	}
! #endif
!     }
! 
!     /* define the new console buffer size */
      coordScreen.X = xSize;
      coordScreen.Y = ySize;
  
!     if (!SetConsoleScreenBufferSize(hConsole, coordScreen))
      {
! #ifdef MCH_WRITE_DUMP
! 	if (fdDump)
! 	{
! 	    fprintf(fdDump, "SetConsoleScreenBufferSize failed: %lx\n",
! 		    GetLastError());
! 	    fflush(fdDump);
! 	}
! #endif
      }
  }
  
--- 4061,4080 ----
  	}
      }
  
!     // define the new console buffer size
      coordScreen.X = xSize;
      coordScreen.Y = ySize;
  
!     // In the new console call API in reverse order
!     if (!vtp_working)
      {
! 	ResizeWindow(hConsole, srWindowRect);
! 	ResizeConBuf(hConsole, coordScreen);
!     }
!     else
!     {
! 	ResizeConBuf(hConsole, coordScreen);
! 	ResizeWindow(hConsole, srWindowRect);
      }
  }
  
*** ../vim-8.1.0249/src/version.c	2018-08-07 20:01:34.245746660 +0200
--- src/version.c	2018-08-07 20:44:49.633662912 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     250,
  /**/

-- 
Vi beats Emacs to death, and then again!
			http://linuxtoday.com/stories/5764.html

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///