diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-08-29 06:16:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-29 06:16:20 +0800 |
| commit | 1dcaa75a6564b8a90e74a96e242803c6aa3f59cf (patch) | |
| tree | 96d63da1db563c7973d8774d387e34fcd1894f9e /src/nvim/testdir | |
| parent | b21980bd607e952fe52957aec3214367bd48527b (diff) | |
| download | rneovim-1dcaa75a6564b8a90e74a96e242803c6aa3f59cf.tar.gz rneovim-1dcaa75a6564b8a90e74a96e242803c6aa3f59cf.tar.bz2 rneovim-1dcaa75a6564b8a90e74a96e242803c6aa3f59cf.zip | |
fix(events): triggered WinScrolled when only skipcol changed (#19972)
fix(events): trigger WinScrolled when only skipcol changed
vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes
Problem: WinScrolled is not triggered when only skipcol changes.
Solution: Add w_last_skipcol and use it. (closes vim/vim#10998)
https://github.com/vim/vim/commit/670ab0334b536e12d84810de88e73b7bcb01346d
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index a249c2bf50..27bc6303cf 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -341,6 +341,39 @@ func Test_WinScrolled_close_curwin() call delete('Xtestout') endfunc +func Test_WinScrolled_long_wrapped() + CheckRunVimInTerminal + + let lines =<< trim END + set scrolloff=0 + let height = winheight(0) + let width = winwidth(0) + let g:scrolled = 0 + au WinScrolled * let g:scrolled += 1 + call setline(1, repeat('foo', height * width)) + call cursor(1, height * width) + END + call writefile(lines, 'Xtest_winscrolled_long_wrapped') + let buf = RunVimInTerminal('-S Xtest_winscrolled_long_wrapped', {'rows': 6}) + + call term_sendkeys(buf, ":echo g:scrolled\<CR>") + call WaitForAssert({-> assert_match('^0 ', term_getline(buf, 6))}, 1000) + + call term_sendkeys(buf, 'gj') + call term_sendkeys(buf, ":echo g:scrolled\<CR>") + call WaitForAssert({-> assert_match('^1 ', term_getline(buf, 6))}, 1000) + + call term_sendkeys(buf, '0') + call term_sendkeys(buf, ":echo g:scrolled\<CR>") + call WaitForAssert({-> assert_match('^2 ', term_getline(buf, 6))}, 1000) + + call term_sendkeys(buf, '$') + call term_sendkeys(buf, ":echo g:scrolled\<CR>") + call WaitForAssert({-> assert_match('^3 ', term_getline(buf, 6))}, 1000) + + call delete('Xtest_winscrolled_long_wrapped') +endfunc + func Test_WinClosed() " Test that the pattern is matched against the closed window's ID, and both " <amatch> and <afile> are set to it. |