aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/diff_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r--test/functional/ui/diff_spec.lua73
1 files changed, 71 insertions, 2 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index a8d9fb02fc..df750a1a68 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1057,7 +1057,7 @@ it('diff updates line numbers below filler lines', function()
vnew
call setline(1, ['a', 'a', 'a', 'x', 'x', 'x', 'b', 'b', 'b', 'b', 'b'])
windo diffthis
- setlocal number rnu foldcolumn=0
+ setlocal number rnu cursorline cursorlineopt=number foldcolumn=0
]])
screen:expect([[
{1: }a {3:│}{10:1 }^a |
@@ -1109,7 +1109,7 @@ it('diff updates line numbers below filler lines', function()
{3:[No Name] [+] }{7:[No Name] [+] }|
|
]])
- command("set signcolumn number tgc cursorline")
+ command("set signcolumn number tgc cursorline cursorlineopt=number,line")
command("hi CursorLineNr guibg=red")
screen:expect{grid=[[
{1: }a {3:│}{11: 2 }a |
@@ -1128,3 +1128,72 @@ it('diff updates line numbers below filler lines', function()
signcolumn=auto |
]]}
end)
+
+it('Align the filler lines when changing text in diff mode', function()
+ clear()
+ local screen = Screen.new(40, 20)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Gray};
+ [2] = {background = Screen.colors.LightCyan, foreground = Screen.colors.Blue1, bold = true};
+ [3] = {reverse = true};
+ [4] = {background = Screen.colors.LightBlue};
+ [5] = {background = Screen.colors.LightMagenta};
+ [6] = {background = Screen.colors.Red, bold = true};
+ [7] = {foreground = Screen.colors.Blue1, bold = true};
+ [8] = {reverse = true, bold = true};
+ })
+ source([[
+ call setline(1, range(1, 15))
+ vnew
+ call setline(1, range(9, 15))
+ windo diffthis
+ wincmd h
+ exe "normal Gl5\<C-E>"
+ ]])
+ screen:expect{grid=[[
+ {1: }{2:------------------}{3:│}{1: }{4:6 }|
+ {1: }{2:------------------}{3:│}{1: }{4:7 }|
+ {1: }{2:------------------}{3:│}{1: }{4:8 }|
+ {1: }9 {3:│}{1: }9 |
+ {1: }10 {3:│}{1: }10 |
+ {1: }11 {3:│}{1: }11 |
+ {1: }12 {3:│}{1: }12 |
+ {1: }13 {3:│}{1: }13 |
+ {1: }14 {3:│}{1: }14 |
+ {1:- }1^5 {3:│}{1:- }15 |
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {8:[No Name] [+] }{3:[No Name] [+] }|
+ |
+ ]]}
+ feed('ax<Esc>')
+ screen:expect{grid=[[
+ {1: }{2:------------------}{3:│}{1: }{4:6 }|
+ {1: }{2:------------------}{3:│}{1: }{4:7 }|
+ {1: }{2:------------------}{3:│}{1: }{4:8 }|
+ {1: }9 {3:│}{1: }9 |
+ {1: }10 {3:│}{1: }10 |
+ {1: }11 {3:│}{1: }11 |
+ {1: }12 {3:│}{1: }12 |
+ {1: }13 {3:│}{1: }13 |
+ {1: }14 {3:│}{1: }14 |
+ {1: }{5:15}{6:^x}{5: }{3:│}{1: }{5:15 }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {7:~ }{3:│}{7:~ }|
+ {8:[No Name] [+] }{3:[No Name] [+] }|
+ |
+ ]]}
+end)