diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 38 | ||||
-rw-r--r-- | test/old/testdir/test_cursorline.vim | 24 |
2 files changed, 60 insertions, 2 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index b7b46ddfae..277bd96bd8 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -1078,6 +1078,44 @@ describe('CursorLine and CursorLineNr highlights', function() ]]) end) + -- oldtest: Test_cursorline_screenline_resize() + it("'cursorlineopt' screenline is updated on window resize", function() + local screen = Screen.new(75, 8) + screen:attach() + exec([[ + 50vnew + call setline(1, repeat('xyz ', 30)) + setlocal number cursorline cursorlineopt=screenline + normal! $ + ]]) + screen:expect([[ + {8: 1 }xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xy│ | + {8: }z xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz │{1:~ }| + {8: }{21:xyz xyz xyz xyz xyz xyz xyz^ }│{1:~ }| + {1:~ }│{1:~ }|*3 + {3:[No Name] [+] }{2:[No Name] }| + | + ]]) + command('vertical resize -4') + screen:expect([[ + {8: 1 }xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xy│ | + {8: }z xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz │{1:~ }| + {8: }{21:xyz xyz xyz xyz xyz xyz xyz xyz xyz^ }│{1:~ }| + {1:~ }│{1:~ }|*3 + {3:[No Name] [+] }{2:[No Name] }| + | + ]]) + command('set cpoptions+=n') + screen:expect([[ + {8: 1 }xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xy│ | + z xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz │{1:~ }| + {21:xyz xyz xyz xyz xyz xyz xyz xyz^ }│{1:~ }| + {1:~ }│{1:~ }|*3 + {3:[No Name] [+] }{2:[No Name] }| + | + ]]) + end) + -- oldtest: Test_cursorline_after_yank() it('always updated. vim-patch:8.1.0849', function() local screen = Screen.new(50, 5) diff --git a/test/old/testdir/test_cursorline.vim b/test/old/testdir/test_cursorline.vim index 99a812b1de..d9c77c0b36 100644 --- a/test/old/testdir/test_cursorline.vim +++ b/test/old/testdir/test_cursorline.vim @@ -262,14 +262,34 @@ func Test_cursorline_callback() call timer_start(300, 'Func') END - call writefile(lines, 'Xcul_timer') + call writefile(lines, 'Xcul_timer', 'D') let buf = RunVimInTerminal('-S Xcul_timer', #{rows: 8}) call TermWait(buf, 310) call VerifyScreenDump(buf, 'Test_cursorline_callback_1', {}) call StopVimInTerminal(buf) - call delete('Xcul_timer') +endfunc + +func Test_cursorline_screenline_resize() + CheckScreendump + + let lines =<< trim END + 50vnew + call setline(1, repeat('xyz ', 30)) + setlocal number cursorline cursorlineopt=screenline + normal! $ + END + call writefile(lines, 'Xcul_screenline_resize', 'D') + + let buf = RunVimInTerminal('-S Xcul_screenline_resize', #{rows: 8}) + call VerifyScreenDump(buf, 'Test_cursorline_screenline_resize_1', {}) + call term_sendkeys(buf, ":vertical resize -4\<CR>") + call VerifyScreenDump(buf, 'Test_cursorline_screenline_resize_2', {}) + call term_sendkeys(buf, ":set cpoptions+=n\<CR>") + call VerifyScreenDump(buf, 'Test_cursorline_screenline_resize_3', {}) + + call StopVimInTerminal(buf) endfunc func Test_cursorline_screenline_update() |