summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorIbby <33922797+SleepySwords@users.noreply.github.com>2023-08-20 20:24:18 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-20 20:24:18 +0200
commita6ab5e69d3f14da8036a3018e8e93c635803ee8b (patch)
tree91c75c62f575cc7b66fdb65811a17e405fd97211 /src/testdir
parentf6fb52b667eecb58bdd9b26bd462d5da61697cf7 (diff)
patch 9.0.1770: lines disappear when modifying chars before virt textv9.0.1770
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>
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/dumps/Test_modify_text_before_prop_1.dump5
-rw-r--r--src/testdir/dumps/Test_modify_text_before_prop_2.dump5
-rw-r--r--src/testdir/test_textprop.vim22
3 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_modify_text_before_prop_1.dump b/src/testdir/dumps/Test_modify_text_before_prop_1.dump
new file mode 100644
index 0000000000..87305d434f
--- /dev/null
+++ b/src/testdir/dumps/Test_modify_text_before_prop_1.dump
@@ -0,0 +1,5 @@
+| +0#af5f00255#ffffff0@1|1| >t+0#0000000&|e|s|t|_|w|o|r|d|s|a+0&#ffd7ff255@45
+| +0#af5f00255#ffffff0@3|a+0#0000000#ffd7ff255@18| +0&#ffffff0@36
+| +0#af5f00255&@3|a+0#4040ff13&@54|…
+| +0#af5f00255&@1|2| |s+0#0000000&|e|c|o|n|d| |l|i|n|e| @44
+@42|1|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_modify_text_before_prop_2.dump b/src/testdir/dumps/Test_modify_text_before_prop_2.dump
new file mode 100644
index 0000000000..9dc87a4f0a
--- /dev/null
+++ b/src/testdir/dumps/Test_modify_text_before_prop_2.dump
@@ -0,0 +1,5 @@
+| +0#af5f00255#ffffff0@1|1| >a+0#0000000&|s|t|_|w|o|r|d|s|a+0&#ffd7ff255@46
+| +0#af5f00255#ffffff0@3|a+0#0000000#ffd7ff255@17| +0&#ffffff0@37
+| +0#af5f00255&@3|a+0#4040ff13&@54|…
+| +0#af5f00255&@1|2| |s+0#0000000&|e|c|o|n|d| |l|i|n|e| @44
+@42|1|,|1| @10|T|o|p|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 9cf46d7d9b..dcb408c10b 100644
--- 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