From 3b1d31197c7af4d87f7e693a1702b5330411f5aa Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sun, 30 Apr 2023 22:04:35 +0200 Subject: [PATCH] vim-patch:9.0.1502: no test for deleting the end of a long wrapped line Problem: No test for deleting the end of a long wrapped line. Solution: Add a test to check the right text is displayed. (Luuk van Baal, closes vim/vim#12318) https://github.com/vim/vim/commit/5b10a140983c16140d69a214494c4b8af8b34763 Co-authored-by: Luuk van Baal --- test/functional/legacy/display_spec.lua | 47 +++++++++++++++++++++++++ test/old/testdir/test_display.vim | 21 +++++++++++ 2 files changed, 68 insertions(+) diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua index f9b78f5dcd..4952a5c4fe 100644 --- a/test/functional/legacy/display_spec.lua +++ b/test/functional/legacy/display_spec.lua @@ -194,4 +194,51 @@ describe('display', function() it('display "lastline" works correctly with multibyte fillchar', function() run_test_display_lastline(true) end) + + -- oldtest: Test_display_long_lastline + it('display "lastline" shows correct text when end of wrapped line is deleted', function() + local screen = Screen.new(35, 14) + screen:attach() + exec([[ + set display=lastline scrolloff=5 + call setline(1, [ + \'aaaaa'->repeat(100), + \'bbbbb '->repeat(7) .. 'ccccc '->repeat(7) .. 'ddddd '->repeat(7) + \]) + ]]) + feed('482|') + screen:expect([[ + <<repeat(100), + \'bbbbb '->repeat(7) .. 'ccccc '->repeat(7) .. 'ddddd '->repeat(7) + \]) + END + + call writefile(lines, 'XdispLongline', 'D') + let buf = RunVimInTerminal('-S XdispLongline', #{rows: 14, cols: 35}) + + call term_sendkeys(buf, "482|") + call VerifyScreenDump(buf, 'Test_display_long_line_1', {}) + call term_sendkeys(buf, "D") + call VerifyScreenDump(buf, 'Test_display_long_line_2', {}) + + call StopVimInTerminal(buf) +endfunc " vim: shiftwidth=2 sts=2 expandtab