Mercurial > vim
comparison src/testdir/test_window_cmd.vim @ 30439:e3091fc473a1 v9.0.0555
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Commit: https://github.com/vim/vim/commit/20e58561abc4116f3bfbafaef242d886dd77b303
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Fri Sep 23 12:57:09 2022 +0100
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closes #11185)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 23 Sep 2022 14:00:06 +0200 |
parents | b5f67135fcb6 |
children | 04df44c52d65 |
comparison
equal
deleted
inserted
replaced
30438:69be14b8733c | 30439:e3091fc473a1 |
---|---|
1 " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...) | 1 " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...) |
2 | 2 |
3 source check.vim | 3 source check.vim |
4 source screendump.vim | |
4 | 5 |
5 func Test_window_cmd_ls0_with_split() | 6 func Test_window_cmd_ls0_with_split() |
6 set ls=0 | 7 set ls=0 |
7 set splitbelow | 8 set splitbelow |
8 split | 9 split |
1815 %bwipeout! | 1816 %bwipeout! |
1816 set splitbelow& | 1817 set splitbelow& |
1817 set splitscroll& | 1818 set splitscroll& |
1818 endfunc | 1819 endfunc |
1819 | 1820 |
1821 function Test_nosplitscroll_callback() | |
1822 CheckScreendump | |
1823 let lines =<< trim END | |
1824 set nosplitscroll | |
1825 call setline(1, range(&lines)) | |
1826 function WincmdCb(a, b) | |
1827 split | wincmd p | |
1828 endfunction | |
1829 function TermCb(a, b) | |
1830 close | split | |
1831 endfunction | |
1832 nnoremap t <cmd>call popup_create(term_start(&shell, { 'hidden': 1, 'exit_cb': 'TermCb' }), {})<CR> | |
1833 nnoremap j <cmd>call job_start([&shell, &shellcmdflag, "echo"], { 'exit_cb': 'WincmdCb' })<CR> | |
1834 END | |
1835 call writefile(lines, 'XTestNosplitscrollCallback', 'D') | |
1836 let buf = RunVimInTerminal('-S XTestNosplitscrollCallback', #{rows: 8}) | |
1837 | |
1838 call term_sendkeys(buf, "j") | |
1839 call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_1', {}) | |
1840 | |
1841 call term_sendkeys(buf, ":quit\<CR>Htexit\<CR>") | |
1842 call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_2', {}) | |
1843 | |
1844 call term_sendkeys(buf, ":set sb\<CR>:quit\<CR>Gj") | |
1845 call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_3', {}) | |
1846 | |
1847 call term_sendkeys(buf, ":quit\<CR>Gtexit\<CR>") | |
1848 call VerifyScreenDump(buf, 'Test_nosplitscroll_callback_4', {}) | |
1849 endfunc | |
1850 | |
1820 " vim: shiftwidth=2 sts=2 expandtab | 1851 " vim: shiftwidth=2 sts=2 expandtab |