patch 9.0.0705: virtual text truncation does not take padding into account
Problem: Virtual text truncation does not take padding into account.
Solution: Subtract the padding from the available space. (closes #11318)
diff --git a/src/testdir/dumps/Test_long_text_with_padding_1.dump b/src/testdir/dumps/Test_long_text_with_padding_1.dump
new file mode 100644
index 0000000..18ca00c
--- /dev/null
+++ b/src/testdir/dumps/Test_long_text_with_padding_1.dump
@@ -0,0 +1,8 @@
+|f+0&#ffffff0|i|r|s|t| |l|i|n|e| @49
+@3|a+0&#ffd7ff255|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|t|e|r| |a|f|…
+| +0&#ffffff0@29|m+0&#ffd7ff255|o|r|e| |m|o|r|e| |m|o|r|e| |m|o|r|e| |m|o|r|e| |m|o|r|e|…
+|s+0&#ffffff0|e|c|o|n|d| >l|i|n|e| @48
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+| +0#0000000&@41|2|,|8| @10|A|l@1|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index ef612fa..ed0aac8 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -3183,6 +3183,34 @@
call StopVimInTerminal(buf)
endfunc
+func Test_long_text_below_with_padding()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ vim9script
+ setline(1, ['first line', 'second line'])
+ prop_type_add('theprop', {highlight: 'DiffChange'})
+ prop_add(1, 0, {
+ type: 'theprop',
+ text: 'after '->repeat(20),
+ text_align: 'below',
+ text_padding_left: 3,
+ })
+ prop_add(1, 0, {
+ type: 'theprop',
+ text: 'more '->repeat(20),
+ text_align: 'below',
+ text_padding_left: 30,
+ })
+ normal 2Gw
+ END
+ call writefile(lines, 'XlongTextBelowWithPadding', 'D')
+ let buf = RunVimInTerminal('-S XlongTextBelowWithPadding', #{rows: 8, cols: 60})
+ call VerifyScreenDump(buf, 'Test_long_text_with_padding_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_insert_text_change_arg()
CheckRunVimInTerminal