diff src/testdir/test_textprop.vim @ 26384:e624b4ddbdf0 v8.2.3723

patch 8.2.3723: when using 'linebreak' a text property starts too early Commit: https://github.com/vim/vim/commit/acdc911e4e1120ef29d86fce8e890c72cdd1bf30 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 2 19:46:57 2021 +0000 patch 8.2.3723: when using 'linebreak' a text property starts too early Problem: When using 'linebreak' a text property starts too early. Solution: Decrement "bcol" when looking for property start. (closes https://github.com/vim/vim/issues/9242)
author Bram Moolenaar <Bram@vim.org>
date Thu, 02 Dec 2021 21:00:03 +0100
parents 13cce5c82c9a
children 4c16acb2525f
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1651,6 +1651,24 @@ func Test_prop_after_tab()
   call delete('XscriptPropAfterTab')
 endfunc
 
+func Test_prop_after_linebreak()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      set linebreak wrap
+      call printf('%s+(%s)', 'x'->repeat(&columns / 2), 'x'->repeat(&columns / 2))->setline(1)
+      call prop_type_add('test', #{highlight: 'ErrorMsg'})
+      call prop_add(1, (&columns / 2) + 2, #{length: 1, type: 'test'})
+  END
+  call writefile(lines, 'XscriptPropAfterLinebreak')
+  let buf = RunVimInTerminal('-S XscriptPropAfterLinebreak', #{rows: 10})
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_prop_after_linebreak', {})
+
+  call StopVimInTerminal(buf)
+  call delete('XscriptPropAfterLinebreak')
+endfunc
+
 " Buffer number of 0 should be ignored, as if the parameter wasn't passed.
 def Test_prop_bufnr_zero()
   new