aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-05 06:58:14 +0800
committerGitHub <noreply@github.com>2023-06-05 06:58:14 +0800
commit67827edeef5ce3718c40c83ccca07dd1854a0f16 (patch)
tree26aedfd4ae2977d74e391f351b63179ca31ae5d2 /test
parentfdc8e966a9183c08f2afec0817d03b7417a883b3 (diff)
downloadrneovim-67827edeef5ce3718c40c83ccca07dd1854a0f16.tar.gz
rneovim-67827edeef5ce3718c40c83ccca07dd1854a0f16.tar.bz2
rneovim-67827edeef5ce3718c40c83ccca07dd1854a0f16.zip
vim-patch:9.0.1606: using freed memory when 'foldcolumn' is set (#23906)
Problem: Using freed memory when 'foldcolumn' is set. Solution: Save extra pointer to free it later. (closes vim/vim#12492) https://github.com/vim/vim/commit/58e1e010454113a7c8a9b0327c54d2ee7d73d2fd
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_fold.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/old/testdir/test_fold.vim b/test/old/testdir/test_fold.vim
index 2f5c93ca2d..ccd1bfecf8 100644
--- a/test/old/testdir/test_fold.vim
+++ b/test/old/testdir/test_fold.vim
@@ -1555,4 +1555,18 @@ func Test_fold_screenrow_motion()
call assert_equal(1, line('.'))
endfunc
+" This was using freed memory
+func Test_foldcolumn_linebreak_control_char()
+ CheckFeature linebreak
+
+ 5vnew
+ setlocal foldcolumn=1 linebreak
+ call setline(1, "aaa\<C-A>b")
+ redraw
+ call assert_equal([' aaa^', ' Ab '], ScreenLines([1, 2], 5))
+ call assert_equal(screenattr(1, 5), screenattr(2, 2))
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab