aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/diff_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-08-26 12:35:22 +0200
committerGitHub <noreply@github.com>2023-08-26 12:35:22 +0200
commit1bdcb9aaf11e914d4c7af14e8e5be4ed3c5798ae (patch)
treeb86dfc90f7208a5225e2479b8fceda38d44001e3 /test/functional/ui/diff_spec.lua
parent5bb17958c5694a28bd6b97f97adb4064bc79b984 (diff)
parent008154954791001efcc46c28146e21403f3a698b (diff)
downloadrneovim-1bdcb9aaf11e914d4c7af14e8e5be4ed3c5798ae.tar.gz
rneovim-1bdcb9aaf11e914d4c7af14e8e5be4ed3c5798ae.tar.bz2
rneovim-1bdcb9aaf11e914d4c7af14e8e5be4ed3c5798ae.zip
Merge pull request #24824 from bfredl/nocurbuf
refactor(change): do API changes to buffer without curbuf switch
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r--test/functional/ui/diff_spec.lua92
1 files changed, 92 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 0f551e3044..92b7235885 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1251,6 +1251,98 @@ AAAB]]
]]}
end)
end)
+
+ it('redraws with a change to non-current buffer', function()
+ write_file(fname, "aaa\nbbb\nccc\n\nxx", false)
+ write_file(fname_2, "aaa\nbbb\nccc\n\nyy", false)
+ reread()
+ local buf = meths.get_current_buf()
+ command('botright new')
+ screen:expect{grid=[[
+ {1: }aaa │{1: }aaa |
+ {1: }bbb │{1: }bbb |
+ {1: }ccc │{1: }ccc |
+ {1: } │{1: } |
+ {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
+ {6:~ }│{6:~ }|
+ {3:<onal-diff-screen-1 <l-diff-screen-1.2 }|
+ ^ |
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {7:[No Name] }|
+ :e |
+ ]]}
+
+ meths.buf_set_lines(buf, 1, 2, true, {'BBB'})
+ screen:expect{grid=[[
+ {1: }aaa │{1: }aaa |
+ {1: }{8:BBB}{9: }│{1: }{8:bbb}{9: }|
+ {1: }ccc │{1: }ccc |
+ {1: } │{1: } |
+ {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
+ {6:~ }│{6:~ }|
+ {3:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
+ ^ |
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {6:~ }|
+ {7:[No Name] }|
+ :e |
+ ]]}
+ end)
+
+ it('redraws with a change current buffer in another window', function()
+ write_file(fname, "aaa\nbbb\nccc\n\nxx", false)
+ write_file(fname_2, "aaa\nbbb\nccc\n\nyy", false)
+ reread()
+ local buf = meths.get_current_buf()
+ command('botright split | diffoff')
+ screen:expect{grid=[[
+ {1: }aaa │{1: }aaa |
+ {1: }bbb │{1: }bbb |
+ {1: }ccc │{1: }ccc |
+ {1: } │{1: } |
+ {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
+ {6:~ }│{6:~ }|
+ {3:<onal-diff-screen-1 <l-diff-screen-1.2 }|
+ ^aaa |
+ bbb |
+ ccc |
+ |
+ xx |
+ {6:~ }|
+ {6:~ }|
+ {7:Xtest-functional-diff-screen-1 }|
+ :e |
+ ]]}
+
+ meths.buf_set_lines(buf, 1, 2, true, {'BBB'})
+ screen:expect{grid=[[
+ {1: }aaa │{1: }aaa |
+ {1: }{8:BBB}{9: }│{1: }{8:bbb}{9: }|
+ {1: }ccc │{1: }ccc |
+ {1: } │{1: } |
+ {1: }{8:xx}{9: }│{1: }{8:yy}{9: }|
+ {6:~ }│{6:~ }|
+ {3:<-diff-screen-1 [+] <l-diff-screen-1.2 }|
+ ^aaa |
+ BBB |
+ ccc |
+ |
+ xx |
+ {6:~ }|
+ {6:~ }|
+ {7:Xtest-functional-diff-screen-1 [+] }|
+ :e |
+ ]]}
+ end)
end)
it('win_update redraws lines properly', function()