diff options
| author | Billy Su <g4691821@gmail.com> | 2020-04-27 23:29:22 +0800 |
|---|---|---|
| committer | Billy Su <g4691821@gmail.com> | 2020-05-02 17:36:48 +0800 |
| commit | 2f27d37517ecb2c81b2c6376f12ad73dcffcb41f (patch) | |
| tree | d5d074300b5496690dfbd201cef69a65dace43fd /src/nvim/testdir | |
| parent | a6071ac04d7ab1c366b7bb68da9d7d331009a478 (diff) | |
| download | rneovim-2f27d37517ecb2c81b2c6376f12ad73dcffcb41f.tar.gz rneovim-2f27d37517ecb2c81b2c6376f12ad73dcffcb41f.tar.bz2 rneovim-2f27d37517ecb2c81b2c6376f12ad73dcffcb41f.zip | |
vim-patch:8.1.0814: :mksession cannot handle a very long 'runtimepath'
Problem: :mksession cannot handle a very long 'runtimepath'. (Timothy
Madden)
Solution: Expand each part separately, instead of the whole option at once.
(Christian Brabandt, closes vim/vim#3466)
https://github.com/vim/vim/commit/ed18f2c03ae4786b489943cb575bb781a70356e4
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_mksession.vim | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index b7169444d1..8b20ad0c62 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -2,7 +2,7 @@ scriptencoding latin1 -if !has('multi_byte') || !has('mksession') +if !has('mksession') finish endif @@ -122,6 +122,30 @@ func Test_mksession_large_winheight() call delete('Xtest_mks_winheight.out') endfunc +func Test_mksession_rtp() + new + set sessionoptions+=options + let _rtp=&rtp + " Make a real long (invalid) runtimepath value, + " that should exceed PATH_MAX (hopefully) + let newrtp=&rtp.',~'.repeat('/foobar', 1000) + let newrtp.=",".expand("$HOME")."/.vim" + let &rtp=newrtp + + " determine expected value + let expected=split(&rtp, ',') + let expected = map(expected, '"set runtimepath+=".v:val') + let expected = ['set runtimepath='] + expected + let expected = map(expected, {v,w -> substitute(w, $HOME, "~", "g")}) + + mksession! Xtest_mks.out + let &rtp=_rtp + let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "runtimepath"') + call assert_equal(expected, li) + + call delete('Xtest_mks.out') +endfunc + " Verify that arglist is stored correctly to the session file. func Test_mksession_arglist() argdel * |