diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/ui/diff_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.gz rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.bz2 rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r-- | test/functional/ui/diff_spec.lua | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua index dbdf3823ec..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() @@ -1325,6 +1417,7 @@ it('win_update redraws lines properly', function() ]]} end) +-- oldtest: Test_diff_rnu() it('diff updates line numbers below filler lines', function() clear() local screen = Screen.new(40, 14) @@ -1401,6 +1494,7 @@ it('diff updates line numbers below filler lines', function() ]]) end) +-- oldtest: Test_diff_with_scroll_and_change() it('Align the filler lines when changing text in diff mode', function() clear() local screen = Screen.new(40, 20) |