summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1327
blob: 2e8597f3f5387ca9061308ae029d33c8f2b935f0 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1327
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.1327
Problem:    Unnecessary scroll after horizontal split.
Solution:   Don't adjust to fraction if all the text fits in the window.
            (Martin Kunev, closes #4367)
Files:	    src/testdir/test_window_cmd.vim, src/window.c


*** ../vim-8.1.1326/src/testdir/test_window_cmd.vim	2019-04-08 20:01:42.877179442 +0200
--- src/testdir/test_window_cmd.vim	2019-05-12 14:19:25.610639150 +0200
***************
*** 743,748 ****
--- 743,784 ----
    let &so = so_save
  endfunc
  
+ func Test_split_noscroll()
+   let so_save = &so
+   new
+   only
+ 
+   " Make sure windows can hold all content after split.
+   for i in range(1, 20)
+     wincmd +
+     redraw!
+   endfor
+ 
+   call setline (1, range(1, 8))
+   normal 100%
+   split
+ 
+   1wincmd w
+   let winid1 = win_getid()
+   let info1 = getwininfo(winid1)[0]
+ 
+   2wincmd w
+   let winid2 = win_getid()
+   let info2 = getwininfo(winid2)[0]
+ 
+   call assert_equal(1, info1.topline)
+   call assert_equal(1, info2.topline)
+ 
+   " Restore original state.
+   for i in range(1, 20)
+     wincmd -
+     redraw!
+   endfor
+   only!
+   bwipe!
+   let &so = so_save
+ endfunc
+ 
  " Tests for the winnr() function
  func Test_winnr()
    only | tabonly
*** ../vim-8.1.1326/src/window.c	2019-05-01 20:30:19.598426336 +0200
--- src/window.c	2019-05-12 14:19:25.610639150 +0200
***************
*** 5827,5835 ****
      int		sline, line_size;
      int		height = wp->w_height;
  
!     // Don't change w_topline when height is zero.  Don't set w_topline when
!     // 'scrollbind' is set and this isn't the current window.
!     if (height > 0 && (!wp->w_p_scb || wp == curwin))
      {
  	/*
  	 * Find a value for w_topline that shows the cursor at the same
--- 5827,5839 ----
      int		sline, line_size;
      int		height = wp->w_height;
  
!     // Don't change w_topline in any of these cases:
!     // - window height is 0
!     // - 'scrollbind' is set and this isn't the current window
!     // - window height is sufficient to display the whole buffer
!     if (height > 0
!         && (!wp->w_p_scb || wp == curwin)
!         && (height < wp->w_buffer->b_ml.ml_line_count))
      {
  	/*
  	 * Find a value for w_topline that shows the cursor at the same
*** ../vim-8.1.1326/src/version.c	2019-05-12 13:53:46.906851000 +0200
--- src/version.c	2019-05-12 14:20:56.698137045 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1327,
  /**/

-- 
THEOREM: VI is perfect.
PROOF: VI in roman numerals is 6.  The natural numbers < 6 which divide 6 are
1, 2, and 3. 1+2+3 = 6.  So 6 is a perfect number.  Therefore, VI is perfect.
QED
						    -- Arthur Tateishi

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