Patch 8.1.1327

9 views
Skip to first unread message

Bram Moolenaar

unread,
May 12, 2019, 8:25:53 AM5/12/19
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages