1
0
forked from aniani/vim

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 #9242)
This commit is contained in:
Bram Moolenaar
2021-12-02 19:46:57 +00:00
parent 5e86964bf4
commit acdc911e4e
4 changed files with 35 additions and 0 deletions

View File

@@ -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