4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: CTRL-B doesn't go back to the first line of the buffer.
12 Solution: Avoid an overflow when adding MAXCOL.
16 *** ../vim-7.2.365/src/move.c 2010-02-03 17:42:59.000000000 +0100
17 --- src/move.c 2010-02-17 17:49:34.000000000 +0100
20 * Add one line above "lp->lnum". This can be a filler line, a closed fold or
21 * a (wrapped) text line. Uses and sets "lp->fill".
22 * Returns the height of the added line in "lp->height".
23 ! * Lines above the first one are incredibly high.
28 * Add one line above "lp->lnum". This can be a filler line, a closed fold or
29 * a (wrapped) text line. Uses and sets "lp->fill".
30 * Returns the height of the added line in "lp->height".
31 ! * Lines above the first one are incredibly high: MAXCOL.
38 loff.lnum = curwin->w_topline;
40 ! if (used + loff.height > curwin->w_height)
46 loff.lnum = curwin->w_topline;
48 ! if (loff.height == MAXCOL || used + loff.height > curwin->w_height)
55 /* Add one line above */
57 ! used += loff.height;
58 if (used > curwin->w_height)
60 if (loff.lnum >= curwin->w_botline
63 /* Add one line above */
65 ! if (loff.height == MAXCOL)
68 ! used += loff.height;
69 if (used > curwin->w_height)
71 if (loff.lnum >= curwin->w_botline
74 if (below > above) /* add a line above the cursor */
77 ! used += loff.height;
78 if (used > curwin->w_height)
82 if (below > above) /* add a line above the cursor */
85 ! if (loff.height == MAXCOL)
88 ! used += loff.height;
89 if (used > curwin->w_height)
94 while (n <= curwin->w_height && loff.lnum >= 1)
99 ! if (n <= curwin->w_height) /* at begin of file */
101 curwin->w_topline = 1;
104 while (n <= curwin->w_height && loff.lnum >= 1)
107 ! if (loff.height == MAXCOL)
112 ! if (loff.lnum < 1) /* at begin of file */
114 curwin->w_topline = 1;
116 *** ../vim-7.2.365/src/version.c 2010-02-17 17:34:38.000000000 +0100
117 --- src/version.c 2010-02-17 18:13:22.000000000 +0100
121 { /* Add new patch number below this line */
127 hundred-and-one symptoms of being an internet addict:
128 247. You use www.switchboard.com instead of dialing 411 and 555-12-12
129 for directory assistance.
131 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
132 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
133 \\\ download, build and distribute -- http://www.A-A-P.org ///
134 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///