1
0
forked from aniani/vim

patch 7.4.2323

Problem:    Using freed memory when using 'formatexpr'. (Dominique Pelle)
Solution:   Make a copy of 'formatexpr' before evaluating it.
This commit is contained in:
Bram Moolenaar
2016-09-04 15:13:39 +02:00
parent bc54f3f3fe
commit d77f9d595e
3 changed files with 34 additions and 1 deletions

View File

@@ -192,6 +192,30 @@ func! Test_normal05_formatexpr()
bw!
endfu
func Test_normal05_formatexpr_newbuf()
" Edit another buffer in the 'formatexpr' function
new
func! Format()
edit another
endfunc
set formatexpr=Format()
norm gqG
bw!
set formatexpr=
endfunc
func Test_normal05_formatexpr_setopt()
" Change the 'formatexpr' value in the function
new
func! Format()
set formatexpr=
endfunc
set formatexpr=Format()
norm gqG
bw!
set formatexpr=
endfunc
func! Test_normal06_formatprg()
" basic test for formatprg
" only test on non windows platform