Mercurial > vim
comparison src/testdir/test_window_cmd.vim @ 16650:06fd0eaada01 v8.1.1327
patch 8.1.1327: unnecessary scroll after horizontal split
commit https://github.com/vim/vim/commit/a9b2535f44f3265940a18d08520a9ad4ef7bda82
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 12 14:25:30 2019 +0200
patch 8.1.1327: unnecessary scroll after horizontal split
Problem: Unnecessary scroll after horizontal split.
Solution: Don't adjust to fraction if all the text fits in the window.
(Martin Kunev, closes #4367)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 May 2019 14:30:08 +0200 |
parents | 243cdc183ec9 |
children | 4e3c4e8e465c |
comparison
equal
deleted
inserted
replaced
16649:5d15f9774fda | 16650:06fd0eaada01 |
---|---|
741 only! | 741 only! |
742 bwipe! | 742 bwipe! |
743 let &so = so_save | 743 let &so = so_save |
744 endfunc | 744 endfunc |
745 | 745 |
746 func Test_split_noscroll() | |
747 let so_save = &so | |
748 new | |
749 only | |
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% | |
759 split | |
760 | |
761 1wincmd w | |
762 let winid1 = win_getid() | |
763 let info1 = getwininfo(winid1)[0] | |
764 | |
765 2wincmd w | |
766 let winid2 = win_getid() | |
767 let info2 = getwininfo(winid2)[0] | |
768 | |
769 call assert_equal(1, info1.topline) | |
770 call assert_equal(1, info2.topline) | |
771 | |
772 " Restore original state. | |
773 for i in range(1, 20) | |
774 wincmd - | |
775 redraw! | |
776 endfor | |
777 only! | |
778 bwipe! | |
779 let &so = so_save | |
780 endfunc | |
781 | |
746 " Tests for the winnr() function | 782 " Tests for the winnr() function |
747 func Test_winnr() | 783 func Test_winnr() |
748 only | tabonly | 784 only | tabonly |
749 call assert_equal(1, winnr('j')) | 785 call assert_equal(1, winnr('j')) |
750 call assert_equal(1, winnr('k')) | 786 call assert_equal(1, winnr('k')) |