aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/diff_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-19 09:20:24 +0800
committerGitHub <noreply@github.com>2024-06-19 09:20:24 +0800
commitb1c439cef6cae54745f3bf446596c1b7e417c80e (patch)
tree5afb90a872d358ba1307672ebdface70be9e7401 /test/functional/ui/diff_spec.lua
parentb381b2d529741ddd4f3664959640917a10cd91b5 (diff)
downloadrneovim-b1c439cef6cae54745f3bf446596c1b7e417c80e.tar.gz
rneovim-b1c439cef6cae54745f3bf446596c1b7e417c80e.tar.bz2
rneovim-b1c439cef6cae54745f3bf446596c1b7e417c80e.zip
fix(drawline): don't draw beyond end of window with 'rnu' (#29406)
Diffstat (limited to 'test/functional/ui/diff_spec.lua')
-rw-r--r--test/functional/ui/diff_spec.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index e79621f364..bad35dd2af 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1346,6 +1346,46 @@ it("diff mode doesn't restore invalid 'foldcolumn' value #21647", function()
eq('0', api.nvim_get_option_value('foldcolumn', {}))
end)
+it("'relativenumber' doesn't draw beyond end of window in diff mode #29403", function()
+ local screen = Screen.new(60, 12)
+ screen:attach()
+ command('set relativenumber')
+ feed('10aa<CR><Esc>gg')
+ command('vnew')
+ feed('ab<CR><Esc>gg')
+ command('windo diffthis')
+ command('wincmd |')
+ screen:expect([[
+ {8: }│{7: }{8: 0 }{27:^a}{4: }|
+ {8: }│{7: }{8: 1 }{22:a }|
+ {8: }│{7: }{8: 2 }{22:a }|
+ {8: }│{7: }{8: 3 }{22:a }|
+ {8: }│{7: }{8: 4 }{22:a }|
+ {8: }│{7: }{8: 5 }{22:a }|
+ {8: }│{7: }{8: 6 }{22:a }|
+ {8: }│{7: }{8: 7 }{22:a }|
+ {8: }│{7: }{8: 8 }{22:a }|
+ {8: }│{7: }{8: 9 }{22:a }|
+ {2:< }{3:[No Name] [+] }|
+ |
+ ]])
+ feed('j')
+ screen:expect([[
+ {8: }│{7: }{8: 1 }{27:a}{4: }|
+ {8: }│{7: }{8: 0 }{22:^a }|
+ {8: }│{7: }{8: 1 }{22:a }|
+ {8: }│{7: }{8: 2 }{22:a }|
+ {8: }│{7: }{8: 3 }{22:a }|
+ {8: }│{7: }{8: 4 }{22:a }|
+ {8: }│{7: }{8: 5 }{22:a }|
+ {8: }│{7: }{8: 6 }{22:a }|
+ {8: }│{7: }{8: 7 }{22:a }|
+ {8: }│{7: }{8: 8 }{22:a }|
+ {2:< }{3:[No Name] [+] }|
+ |
+ ]])
+end)
+
-- oldtest: Test_diff_binary()
it('diff mode works properly if file contains NUL bytes vim-patch:8.2.3925', function()
local screen = Screen.new(40, 20)