Mercurial > vim
diff src/testdir/test_textprop.vim @ 32925:5d17e74a756d v9.0.1770
patch 9.0.1770: lines disappear when modifying chars before virt text
Commit: https://github.com/vim/vim/commit/a6ab5e69d3f14da8036a3018e8e93c635803ee8b
Author: Ibby <33922797+SleepySwords@users.noreply.github.com>
Date: Sun Aug 20 20:24:18 2023 +0200
patch 9.0.1770: lines disappear when modifying chars before virt text
Problem: lines disappear when modifying chars before virt text
Solution: take virtual text property length into account
closes: #12558
closes: #12244
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ibby <33922797+SleepySwords@users.noreply.github.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 20 Aug 2023 20:45:03 +0200 |
parents | 98db7b3b4827 |
children | c7a332a34fe7 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -3979,6 +3979,28 @@ func Test_error_after_using_negative_id( call StopVimInTerminal(buf) endfunc +func Test_modify_text_before_prop() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + setline(1, ['test_words', 'second line', 'third line', 'fourth line']) + set number + prop_type_add('text', {highlight: 'DiffChange'}) + prop_type_add('below', {highlight: 'NonText'}) + prop_add(1, 11, {type: 'text', text: repeat('a', 65)}) + prop_add(1, 0, {type: 'below', text: repeat('a', 65), text_align: 'below'}) + END + call writefile(lines, 'XtextPropModifyBefore', 'D') + let buf = RunVimInTerminal('-S XtextPropModifyBefore', #{rows: 5, cols: 60}) + call VerifyScreenDump(buf, 'Test_modify_text_before_prop_1', {}) + + call term_sendkeys(buf, "xxia\<Esc>") + call VerifyScreenDump(buf, 'Test_modify_text_before_prop_2', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_overlong_textprop_above_crash() CheckRunVimInTerminal