comparison src/testdir/test_window_cmd.vim @ 16690:4e3c4e8e465c v8.1.1347

patch 8.1.1347: fractional scroll position not restored after closing window commit https://github.com/vim/vim/commit/bd2d68c2f42c7689f681aeaf82606d17f8a0312f Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 18 15:36:11 2019 +0200 patch 8.1.1347: fractional scroll position not restored after closing window Problem: Fractional scroll position not restored after closing window. Solution: Do restore fraction if topline is not one.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 May 2019 15:45:05 +0200
parents 06fd0eaada01
children cb71b5e9e5d9
comparison
equal deleted inserted replaced
16689:7f784d132212 16690:4e3c4e8e465c
743 let &so = so_save 743 let &so = so_save
744 endfunc 744 endfunc
745 745
746 func Test_split_noscroll() 746 func Test_split_noscroll()
747 let so_save = &so 747 let so_save = &so
748 new 748 enew
749 only 749 call setline(1, range(1, 8))
750
751 " Make sure windows can hold all content after split.
752 for i in range(1, 20)
753 wincmd +
754 redraw!
755 endfor
756
757 call setline (1, range(1, 8))
758 normal 100% 750 normal 100%
759 split 751 split
760 752
761 1wincmd w 753 1wincmd w
762 let winid1 = win_getid() 754 let winid1 = win_getid()
767 let info2 = getwininfo(winid2)[0] 759 let info2 = getwininfo(winid2)[0]
768 760
769 call assert_equal(1, info1.topline) 761 call assert_equal(1, info1.topline)
770 call assert_equal(1, info2.topline) 762 call assert_equal(1, info2.topline)
771 763
772 " Restore original state. 764 " window that fits all lines by itself, but not when split: closing other
773 for i in range(1, 20) 765 " window should restore fraction.
774 wincmd -
775 redraw!
776 endfor
777 only! 766 only!
767 call setline(1, range(1, &lines - 10))
768 exe &lines / 4
769 let winid1 = win_getid()
770 let info1 = getwininfo(winid1)[0]
771 call assert_equal(1, info1.topline)
772 new
773 redraw
774 close
775 let info1 = getwininfo(winid1)[0]
776 call assert_equal(1, info1.topline)
777
778 bwipe! 778 bwipe!
779 let &so = so_save 779 let &so = so_save
780 endfunc 780 endfunc
781 781
782 " Tests for the winnr() function 782 " Tests for the winnr() function