1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When splitting the window, the new one scrolls with the cursor at
13 Solution: Compute w_fraction before setting the new height.
17 *** ../vim-7.3.083/src/window.c 2010-09-21 16:56:29.000000000 +0200
18 --- src/window.c 2010-12-17 17:09:51.000000000 +0100
21 #endif /* FEAT_WINDOWS */
23 static win_T *win_alloc __ARGS((win_T *after, int hidden));
24 ! static void win_new_height __ARGS((win_T *, int));
26 #define URL_SLASH 1 /* path_is_url() has found "://" */
27 #define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */
29 #endif /* FEAT_WINDOWS */
31 static win_T *win_alloc __ARGS((win_T *after, int hidden));
32 ! static void set_fraction __ARGS((win_T *wp));
33 ! static void win_new_height __ARGS((win_T *wp, int height));
35 #define URL_SLASH 1 /* path_is_url() has found "://" */
36 #define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */
41 frame_append(curfrp, frp);
43 + /* Set w_fraction now so that the cursor keeps the same relative
44 + * vertical position. */
45 + set_fraction(oldwin);
46 + wp->w_fraction = oldwin->w_fraction;
51 wp->w_p_scr = curwin->w_p_scr;
55 win_new_height(oldwin, oldwin->w_height - 1);
60 #endif /* FEAT_WINDOWS */
62 + #define FRACTION_MULT 16384L
65 + * Set wp->w_fraction for the current w_wrow and w_height.
71 + wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
72 + + FRACTION_MULT / 2) / (long)wp->w_height;
76 * Set the height of a window.
77 * This takes care of the things inside the window, not what happens to the
83 - #define FRACTION_MULT 16384L
85 /* Don't want a negative height. Happens when splitting a tiny window.
86 * Will equalize heights soon to fix it. */
90 return; /* nothing to do */
92 if (wp->w_wrow != wp->w_prev_fraction_row && wp->w_height > 0)
93 ! wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
94 ! + FRACTION_MULT / 2) / (long)wp->w_height;
96 wp->w_height = height;
99 return; /* nothing to do */
101 if (wp->w_wrow != wp->w_prev_fraction_row && wp->w_height > 0)
104 wp->w_height = height;
106 *** ../vim-7.3.083/src/version.c 2010-12-17 16:27:10.000000000 +0100
107 --- src/version.c 2010-12-17 17:14:19.000000000 +0100
111 { /* Add new patch number below this line */
117 How To Keep A Healthy Level Of Insanity:
118 12. Sing along at the opera.
120 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
121 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
122 \\\ an exciting new programming language -- http://www.Zimbu.org ///
123 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///