Mercurial > vim
diff src/testdir/test_textprop.vim @ 32301:15352bf5c33e v9.0.1482
patch 9.0.1482: crash when textprop has a very large "padding" value
Commit: https://github.com/vim/vim/commit/2354b66ac52a8a9165e8bd0d642e19e757ba12c3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 23 21:42:25 2023 +0100
patch 9.0.1482: crash when textprop has a very large "padding" value
Problem: Crash when textprop has a very large "padding" value. (Yegappan
Lakshmanan)
Solution: Avoid the "after" count to go negative.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 23 Apr 2023 22:45:04 +0200 |
parents | 0df66713766e |
children | f1fdbcd46f3a |
line wrap: on
line diff
--- 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'])