diff src/testdir/test_textprop.vim @ 29678:fc0f93590fd4 v9.0.0179

patch 9.0.0179: cursor pos wrong with wrapping virtual text in empty line Commit: https://github.com/vim/vim/commit/49a90792d950c51608d0459ef8699fe921070718 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 9 18:25:23 2022 +0100 patch 9.0.0179: cursor pos wrong with wrapping virtual text in empty line Problem: Cursor position wrong with wrapping virtual text in empty line. Solution: Adjust handling of an empty line. (closes https://github.com/vim/vim/issues/10875)
author Bram Moolenaar <Bram@vim.org>
date Tue, 09 Aug 2022 19:30:03 +0200
parents b4fea827c20a
children 955026042e45
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2557,6 +2557,32 @@ func Test_props_with_text_after_truncate
   call delete('XscriptPropsWithTextAfterTrunc')
 endfunc
 
+func Test_props_with_text_empty_line()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      call setline(1, ['', 'aaa', '', 'bbbbbb'])
+      call prop_type_add('prop1', #{highlight: 'Search'})
+      call prop_add(1, 1, #{type: 'prop1', text_wrap: 'wrap', text: repeat('X', &columns)})
+      call prop_add(3, 1, #{type: 'prop1', text_wrap: 'wrap', text: repeat('X', &columns + 1)})
+      normal gg0
+  END
+  call writefile(lines, 'XscriptPropsWithTextEmptyLine')
+  let buf = RunVimInTerminal('-S XscriptPropsWithTextEmptyLine', #{rows: 8, cols: 60})
+  call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_1', {})
+  call term_sendkeys(buf, "$")
+  call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_2', {})
+  call term_sendkeys(buf, "j")
+  call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_3', {})
+  call term_sendkeys(buf, "j")
+  call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_4', {})
+  call term_sendkeys(buf, "j")
+  call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_5', {})
+
+  call StopVimInTerminal(buf)
+  call delete('XscriptPropsWithTextEmptyLine')
+endfunc
+
 func Test_props_with_text_after_wraps()
   CheckRunVimInTerminal