aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/diff_spec.lua106
1 files changed, 106 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index d6a04f90f6..8b965e8a97 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -2054,3 +2054,109 @@ it('diff mode overlapped diff blocks will be merged', function()
|
]])
end)
+
+-- oldtest: Test_diff_topline_noscroll()
+it('diff mode does not scroll with line("w0")', function()
+ local screen = Screen.new(45, 20)
+ screen:attach()
+ exec([[
+ set scrolloff=5
+ call setline(1, range(1,60))
+ vnew
+ call setline(1, range(1,10) + range(50,60))
+ windo diffthis
+ norm! G
+ exe "norm! 30\<C-y>"
+ ]])
+ screen:expect([[
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:--------------------}│{7: }{22:11 }|
+ {7: }{23:--------------------}│{7: }{22:12 }|
+ {7: }{23:--------------------}│{7: }{22:13 }|
+ {7: }{23:--------------------}│{7: }{22:14 }|
+ {7: }{23:--------------------}│{7: }{22:15 }|
+ {7: }{23:--------------------}│{7: }{22:16 }|
+ {7: }{23:--------------------}│{7: }{22:17 }|
+ {7: }{23:--------------------}│{7: }{22:18 }|
+ {7: }{23:--------------------}│{7: }{22:19 }|
+ {7: }{23:--------------------}│{7: }{22:20 }|
+ {7: }{23:--------------------}│{7: }{22:^21 }|
+ {7: }{23:--------------------}│{7: }{22:22 }|
+ {7: }{23:--------------------}│{7: }{22:23 }|
+ {7: }{23:--------------------}│{7: }{22:24 }|
+ {7: }{23:--------------------}│{7: }{22:25 }|
+ {7: }{23:--------------------}│{7: }{22:26 }|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
+ |
+ ]])
+ command([[echo line('w0', 1001)]])
+ screen:expect([[
+ {7: }9 │{7: }9 |
+ {7: }10 │{7: }10 |
+ {7: }{23:--------------------}│{7: }{22:11 }|
+ {7: }{23:--------------------}│{7: }{22:12 }|
+ {7: }{23:--------------------}│{7: }{22:13 }|
+ {7: }{23:--------------------}│{7: }{22:14 }|
+ {7: }{23:--------------------}│{7: }{22:15 }|
+ {7: }{23:--------------------}│{7: }{22:16 }|
+ {7: }{23:--------------------}│{7: }{22:17 }|
+ {7: }{23:--------------------}│{7: }{22:18 }|
+ {7: }{23:--------------------}│{7: }{22:19 }|
+ {7: }{23:--------------------}│{7: }{22:20 }|
+ {7: }{23:--------------------}│{7: }{22:^21 }|
+ {7: }{23:--------------------}│{7: }{22:22 }|
+ {7: }{23:--------------------}│{7: }{22:23 }|
+ {7: }{23:--------------------}│{7: }{22:24 }|
+ {7: }{23:--------------------}│{7: }{22:25 }|
+ {7: }{23:--------------------}│{7: }{22:26 }|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
+ 9 |
+ ]])
+ feed('<C-W>p')
+ screen:expect([[
+ {7: }{23:--------------------}│{7: }{22:39 }|
+ {7: }{23:--------------------}│{7: }{22:40 }|
+ {7: }{23:--------------------}│{7: }{22:41 }|
+ {7: }{23:--------------------}│{7: }{22:42 }|
+ {7: }{23:--------------------}│{7: }{22:43 }|
+ {7: }{23:--------------------}│{7: }{22:44 }|
+ {7: }{23:--------------------}│{7: }{22:45 }|
+ {7: }{23:--------------------}│{7: }{22:46 }|
+ {7: }{23:--------------------}│{7: }{22:47 }|
+ {7: }{23:--------------------}│{7: }{22:48 }|
+ {7: }{23:--------------------}│{7: }{22:49 }|
+ {7: }^50 │{7: }50 |
+ {7: }51 │{7: }51 |
+ {7: }52 │{7: }52 |
+ {7: }53 │{7: }53 |
+ {7: }54 │{7: }54 |
+ {7: }55 │{7: }55 |
+ {7:+ }{13:+-- 5 lines: 56····}│{7:+ }{13:+-- 5 lines: 56····}|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
+ 9 |
+ ]])
+ feed('<C-W>p')
+ screen:expect([[
+ {7: }{23:--------------------}│{7: }{22:39 }|
+ {7: }{23:--------------------}│{7: }{22:40 }|
+ {7: }{23:--------------------}│{7: }{22:41 }|
+ {7: }{23:--------------------}│{7: }{22:42 }|
+ {7: }{23:--------------------}│{7: }{22:43 }|
+ {7: }{23:--------------------}│{7: }{22:^44 }|
+ {7: }{23:--------------------}│{7: }{22:45 }|
+ {7: }{23:--------------------}│{7: }{22:46 }|
+ {7: }{23:--------------------}│{7: }{22:47 }|
+ {7: }{23:--------------------}│{7: }{22:48 }|
+ {7: }{23:--------------------}│{7: }{22:49 }|
+ {7: }50 │{7: }50 |
+ {7: }51 │{7: }51 |
+ {7: }52 │{7: }52 |
+ {7: }53 │{7: }53 |
+ {7: }54 │{7: }54 |
+ {7: }55 │{7: }55 |
+ {7:+ }{13:+-- 5 lines: 56····}│{7:+ }{13:+-- 5 lines: 56····}|
+ {2:[No Name] [+] }{3:[No Name] [+] }|
+ 9 |
+ ]])
+end)