summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.280
blob: 6b392df0dfb40f885ea15cbcb13fc2fb96500f1f (plain) (blame)
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
To: vim_dev@googlegroups.com
Subject: Patch 7.4.280
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.4.280
Problem:    When using a session file the relative position of the cursor is
	    not restored if there is another tab. (Nobuhiro Takasaki)
Solution:   Update w_wrow before calculating the fraction.
Files:	    src/window.c


*** ../vim-7.4.279/src/window.c	2014-03-23 15:12:29.943264337 +0100
--- src/window.c	2014-05-07 20:18:55.237270409 +0200
***************
*** 5623,5629 ****
      win_T	*wp;
  {
      wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
! 				    + FRACTION_MULT / 2) / (long)wp->w_height;
  }
  
  /*
--- 5623,5629 ----
      win_T	*wp;
  {
      wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
! 				    + wp->w_height / 2) / (long)wp->w_height;
  }
  
  /*
***************
*** 5638,5643 ****
--- 5638,5644 ----
  {
      linenr_T	lnum;
      int		sline, line_size;
+     int		prev_height = wp->w_height;
  
      /* Don't want a negative height.  Happens when splitting a tiny window.
       * Will equalize heights soon to fix it. */
***************
*** 5646,5653 ****
      if (wp->w_height == height)
  	return;	    /* nothing to do */
  
!     if (wp->w_wrow != wp->w_prev_fraction_row && wp->w_height > 0)
! 	set_fraction(wp);
  
      wp->w_height = height;
      wp->w_skipcol = 0;
--- 5647,5659 ----
      if (wp->w_height == height)
  	return;	    /* nothing to do */
  
!     if (wp->w_height > 0)
!     {
! 	if (wp == curwin)
! 	    validate_cursor();		/* w_wrow needs to be valid */
! 	if (wp->w_wrow != wp->w_prev_fraction_row)
! 	    set_fraction(wp);
!     }
  
      wp->w_height = height;
      wp->w_skipcol = 0;
***************
*** 5667,5673 ****
  	lnum = wp->w_cursor.lnum;
  	if (lnum < 1)		/* can happen when starting up */
  	    lnum = 1;
! 	wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L) / FRACTION_MULT;
  	line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
  	sline = wp->w_wrow - line_size;
  
--- 5673,5680 ----
  	lnum = wp->w_cursor.lnum;
  	if (lnum < 1)		/* can happen when starting up */
  	    lnum = 1;
! 	wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L
! 					 + FRACTION_MULT / 2) / FRACTION_MULT;
  	line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
  	sline = wp->w_wrow - line_size;
  
***************
*** 5757,5763 ****
  	    update_topline();
  	curs_columns(FALSE);	/* validate w_wrow */
      }
!     wp->w_prev_fraction_row = wp->w_wrow;
  
      win_comp_scroll(wp);
      redraw_win_later(wp, SOME_VALID);
--- 5764,5771 ----
  	    update_topline();
  	curs_columns(FALSE);	/* validate w_wrow */
      }
!     if (prev_height > 0)
! 	wp->w_prev_fraction_row = wp->w_wrow;
  
      win_comp_scroll(wp);
      redraw_win_later(wp, SOME_VALID);
*** ../vim-7.4.279/src/version.c	2014-05-07 18:35:25.669216052 +0200
--- src/version.c	2014-05-07 20:24:14.313273202 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     280,
  /**/

-- 
~
~
~
".signature" 4 lines, 50 characters written

 /// 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    ///