summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.2.366
blob: 952a0f2f2d7dbcd35a97aec5e544d5f85aed22d5 (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
To: vim-dev@vim.org
Subject: Patch 7.2.366
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.366
Problem:    CTRL-B doesn't go back to the first line of the buffer.
Solution:   Avoid an overflow when adding MAXCOL.
Files:	    src/move.c


*** ../vim-7.2.365/src/move.c	2010-02-03 17:42:59.000000000 +0100
--- src/move.c	2010-02-17 17:49:34.000000000 +0100
***************
*** 1610,1616 ****
   * Add one line above "lp->lnum".  This can be a filler line, a closed fold or
   * a (wrapped) text line.  Uses and sets "lp->fill".
   * Returns the height of the added line in "lp->height".
!  * Lines above the first one are incredibly high.
   */
      static void
  topline_back(lp)
--- 1610,1616 ----
   * Add one line above "lp->lnum".  This can be a filler line, a closed fold or
   * a (wrapped) text line.  Uses and sets "lp->fill".
   * Returns the height of the added line in "lp->height".
!  * Lines above the first one are incredibly high: MAXCOL.
   */
      static void
  topline_back(lp)
***************
*** 1942,1948 ****
  	{
  	    loff.lnum = curwin->w_topline;
  	    topline_back(&loff);
! 	    if (used + loff.height > curwin->w_height)
  		break;
  	    used += loff.height;
  #ifdef FEAT_DIFF
--- 1942,1948 ----
  	{
  	    loff.lnum = curwin->w_topline;
  	    topline_back(&loff);
! 	    if (loff.height == MAXCOL || used + loff.height > curwin->w_height)
  		break;
  	    used += loff.height;
  #ifdef FEAT_DIFF
***************
*** 2021,2027 ****
  
  	/* Add one line above */
  	topline_back(&loff);
! 	used += loff.height;
  	if (used > curwin->w_height)
  	    break;
  	if (loff.lnum >= curwin->w_botline
--- 2021,2030 ----
  
  	/* Add one line above */
  	topline_back(&loff);
! 	if (loff.height == MAXCOL)
! 	    used = MAXCOL;
! 	else
! 	    used += loff.height;
  	if (used > curwin->w_height)
  	    break;
  	if (loff.lnum >= curwin->w_botline
***************
*** 2175,2181 ****
  	if (below > above)	    /* add a line above the cursor */
  	{
  	    topline_back(&loff);
! 	    used += loff.height;
  	    if (used > curwin->w_height)
  		break;
  	    above += loff.height;
--- 2178,2187 ----
  	if (below > above)	    /* add a line above the cursor */
  	{
  	    topline_back(&loff);
! 	    if (loff.height == MAXCOL)
! 		used = MAXCOL;
! 	    else
! 		used += loff.height;
  	    if (used > curwin->w_height)
  		break;
  	    above += loff.height;
***************
*** 2472,2480 ****
  	    while (n <= curwin->w_height && loff.lnum >= 1)
  	    {
  		topline_back(&loff);
! 		n += loff.height;
  	    }
! 	    if (n <= curwin->w_height)		    /* at begin of file */
  	    {
  		curwin->w_topline = 1;
  #ifdef FEAT_DIFF
--- 2478,2489 ----
  	    while (n <= curwin->w_height && loff.lnum >= 1)
  	    {
  		topline_back(&loff);
! 		if (loff.height == MAXCOL)
! 		    n = MAXCOL;
! 		else
! 		    n += loff.height;
  	    }
! 	    if (loff.lnum < 1)			/* at begin of file */
  	    {
  		curwin->w_topline = 1;
  #ifdef FEAT_DIFF
*** ../vim-7.2.365/src/version.c	2010-02-17 17:34:38.000000000 +0100
--- src/version.c	2010-02-17 18:13:22.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     366,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
247. You use www.switchboard.com instead of dialing 411 and 555-12-12
     for directory assistance.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///