mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.1533: test for 'smoothscroll' is ineffective
Problem: Test for 'smoothscroll' is ineffective.
Solution: Change the order of testing "zb" and "zt". (Luuk van Baal,
closes vim/vim#12366)
6f37e530d3
This commit is contained in:
parent
1caad791b4
commit
d5780e133a
@ -556,13 +556,13 @@ describe('smoothscroll', function()
|
||||
|
|
||||
]])
|
||||
-- Test zt/zz/zb that they work properly when a long line is above it
|
||||
feed('zb')
|
||||
feed('zt')
|
||||
screen:expect([[
|
||||
<<<th lots of text with lots of text wit|
|
||||
h lots of text with lots of text with lo|
|
||||
ts of text with lots of text with lots o|
|
||||
f text with lots of text end |
|
||||
^four |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]])
|
||||
feed('zz')
|
||||
@ -574,21 +574,7 @@ describe('smoothscroll', function()
|
||||
~ |
|
||||
|
|
||||
]])
|
||||
feed('zt')
|
||||
screen:expect([[
|
||||
^four |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
~ |
|
||||
|
|
||||
]])
|
||||
-- Repeat the step and move the cursor down again.
|
||||
-- This time, use a shorter long line that is barely long enough to span more
|
||||
-- than one window. Note that the cursor is at the bottom this time because
|
||||
-- Vim prefers to do so if we are scrolling a few lines only.
|
||||
exec("call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(10)) .. ' end', 'four'])")
|
||||
feed('3Gztj')
|
||||
feed('zb')
|
||||
screen:expect([[
|
||||
<<<th lots of text with lots of text wit|
|
||||
h lots of text with lots of text with lo|
|
||||
@ -597,6 +583,13 @@ describe('smoothscroll', function()
|
||||
^four |
|
||||
|
|
||||
]])
|
||||
-- Repeat the step and move the cursor down again.
|
||||
-- This time, use a shorter long line that is barely long enough to span more
|
||||
-- than one window. Note that the cursor is at the bottom this time because
|
||||
-- Vim prefers to do so if we are scrolling a few lines only.
|
||||
exec("call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(10)) .. ' end', 'four'])")
|
||||
feed('3Gztj')
|
||||
screen:expect_unchanged()
|
||||
-- Repeat the step but this time start it when the line is smooth-scrolled by
|
||||
-- one line. This tests that the offset calculation is still correct and
|
||||
-- still end up scrolling down to the next line with cursor at bottom of
|
||||
|
@ -323,11 +323,11 @@ func Test_smoothscroll_wrap_long_line()
|
||||
call VerifyScreenDump(buf, 'Test_smooth_long_10', {})
|
||||
|
||||
" Test zt/zz/zb that they work properly when a long line is above it
|
||||
call term_sendkeys(buf, "zb")
|
||||
call term_sendkeys(buf, "zt")
|
||||
call VerifyScreenDump(buf, 'Test_smooth_long_11', {})
|
||||
call term_sendkeys(buf, "zz")
|
||||
call VerifyScreenDump(buf, 'Test_smooth_long_12', {})
|
||||
call term_sendkeys(buf, "zt")
|
||||
call term_sendkeys(buf, "zb")
|
||||
call VerifyScreenDump(buf, 'Test_smooth_long_13', {})
|
||||
|
||||
" Repeat the step and move the cursor down again.
|
||||
|
Loading…
Reference in New Issue
Block a user