Mercurial > vim
comparison src/testdir/test_window_cmd.vim @ 30271:d8f04df5b917 v9.0.0471
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Commit: https://github.com/vim/vim/commit/12167d8b84c4a99751d9928f1a9a59c90b14931f
Author: mityu <mityu.mail@gmail.com>
Date: Thu Sep 15 17:44:07 2022 +0100
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Problem: No test for what patch 9.0.0469 fixes.
Solution: Add a test. (closes https://github.com/vim/vim/issues/11140)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Sep 2022 18:45:04 +0200 |
parents | 48db7f8f1b44 |
children | 9edb1a8161ac |
comparison
equal
deleted
inserted
replaced
30270:92c9073d3500 | 30271:d8f04df5b917 |
---|---|
1768 set laststatus& | 1768 set laststatus& |
1769 set equalalways& | 1769 set equalalways& |
1770 set splitscroll& | 1770 set splitscroll& |
1771 endfunc | 1771 endfunc |
1772 | 1772 |
1773 function Test_nosplitscroll_cmdwin_cursor_position() | |
1774 set nosplitscroll | |
1775 call setline(1, range(&lines)) | |
1776 | |
1777 " No scroll when cursor is at near bottom of window and cusor position | |
1778 " recompution (done by line('w0') in this test) happens while in cmdwin. | |
1779 normal! G | |
1780 let firstline = line('w0') | |
1781 autocmd CmdwinEnter * ++once autocmd WinEnter * ++once call line('w0') | |
1782 execute "normal! q:\<C-w>q" | |
1783 redraw! | |
1784 call assert_equal(firstline, line('w0')) | |
1785 | |
1786 " User script can change cursor position successfully while in cmdwin and it | |
1787 " shouldn't be changed when closing cmdwin. | |
1788 execute "normal! Gq:\<Cmd>call win_execute(winnr('#')->win_getid(), 'call cursor(1, 1)')\<CR>\<C-w>q" | |
1789 call assert_equal(1, line('.')) | |
1790 call assert_equal(1, col('.')) | |
1791 | |
1792 execute "normal! Gq:\<Cmd>autocmd WinEnter * ++once call cursor(1, 1)\<CR>\<C-w>q" | |
1793 call assert_equal(1, line('.')) | |
1794 call assert_equal(1, col('.')) | |
1795 | |
1796 %bwipeout! | |
1797 set splitscroll& | |
1798 endfunction | |
1773 " vim: shiftwidth=2 sts=2 expandtab | 1799 " vim: shiftwidth=2 sts=2 expandtab |