diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-04-23 21:42:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-23 21:42:25 +0100 |
commit | 2354b66ac52a8a9165e8bd0d642e19e757ba12c3 (patch) | |
tree | 1233f7470292cf4b72583d7ad9fbe0595a290f93 /src/testdir/test_textprop.vim | |
parent | aae583441bcdbb0bfef3b8a1d193e04ae09ca95d (diff) |
patch 9.0.1482: crash when textprop has a very large "padding" valuev9.0.1482
Problem: Crash when textprop has a very large "padding" value. (Yegappan
Lakshmanan)
Solution: Avoid the "after" count to go negative.
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r-- | src/testdir/test_textprop.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index 9cd09bd1bb..550a0e5af5 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -3199,6 +3199,26 @@ func Test_props_with_text_above() call StopVimInTerminal(buf) endfunc +func Test_prop_with_text_above_padding() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + + setlocal tabstop=8 noexpandtab + setline(1, ['', 'sky is blue', 'ocean is blue']) + prop_type_add('DiagVirtualText', {highlight: 'Search', override: true}) + prop_add(3, 0, {text: "┌─ start", text_align: "above", + type: 'DiagVirtualText', + text_padding_left: 200}) + END + call writefile(lines, 'XscriptAbovePadding', 'D') + let buf = RunVimInTerminal('-S XscriptAbovePadding', #{rows: 8}) + call VerifyScreenDump(buf, 'Test_prop_above_padding_1', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_prop_above_with_indent() new call setline(1, ['first line', ' second line', ' line below']) |