mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
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)
5b10a14098
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
This commit is contained in:
parent
f78130b2d8
commit
3b1d31197c
@ -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([[
|
||||
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaa|
|
||||
aaaaaaaaaa |
|
||||
|
|
||||
]])
|
||||
feed('D')
|
||||
screen:expect([[
|
||||
<<<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaa^a |
|
||||
bbbbb bbbbb bbbbb bbbbb bbbbb bb@@@|
|
||||
|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
@ -478,5 +478,26 @@ func Test_display_lastline()
|
||||
call assert_fails(':set fillchars=lastline:〇', 'E474:')
|
||||
endfunc
|
||||
|
||||
func Test_display_long_lastline()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
set display=lastline
|
||||
call setline(1, [
|
||||
\'aaaaa'->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
|
||||
|
Loading…
Reference in New Issue
Block a user