aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/diff_spec.lua
diff options
context:
space:
mode:
authorJaehwang Jerry Jung <tomtomjhj@gmail.com>2021-09-19 01:38:58 +0900
committerGitHub <noreply@github.com>2021-09-18 12:38:58 -0400
commitde406f651c6f926db4223b69ef312777e8afe01b (patch)
treec9f601e7a987e9c94493c7157b8dd6a43d421093 /test/functional/ui/diff_spec.lua
parent51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6 (diff)
downloadrneovim-de406f651c6f926db4223b69ef312777e8afe01b.tar.gz
rneovim-de406f651c6f926db4223b69ef312777e8afe01b.tar.bz2
rneovim-de406f651c6f926db4223b69ef312777e8afe01b.zip
vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)
Problem: Filler lines are wrong when changing text in diff mode. Solution: Don't change the filler lines on every change. Check scrollbinding when updating the filler lines. (closes vim/vim#8809) https://github.com/vim/vim/commit/04626c243c47af91c2580eaf23e12286180e0e81
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r--test/functional/ui/diff_spec.lua69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 6c6735a4cf..df750a1a68 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -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)