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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user