From a890c019a3689fc15d8a5710cfc0cb92c5ac041d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Jul 2022 11:01:46 +0800 Subject: vim-patch:8.2.0132: script may be re-used when deleting and creating a new one Problem: Script may be re-used when deleting and creating a new one. Solution: When the inode matches, also check the file name. https://github.com/vim/vim/commit/ca33eb256eb910af05e8c9852bc9f716cece1f5c --- src/nvim/testdir/test_source.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_source.vim b/src/nvim/testdir/test_source.vim index 09baec0b7d..a5f5d1fd89 100644 --- a/src/nvim/testdir/test_source.vim +++ b/src/nvim/testdir/test_source.vim @@ -46,3 +46,15 @@ func Test_source_sandbox() bwipe! call delete('Xsourcehello') endfunc + +" When deleting a file and immediately creating a new one the inode may be +" recycled. Vim should not recognize it as the same script. +func Test_different_script() + call ch_logfile('logfile', 'w') + call writefile(['let s:var = "asdf"'], 'XoneScript') + source XoneScript + call delete('XoneScript') + call writefile(['let g:var = s:var'], 'XtwoScript') + call assert_fails('source XtwoScript', 'E121:') + call delete('XtwoScript') +endfunc -- cgit From eafa09de7d4129fee10e0558ee8e47a49758f0fe Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Jul 2022 11:03:33 +0800 Subject: vim-patch:8.2.0136: stray ch_logfile() call Problem: Stray ch_logfile() call. Solution: Remove it. (closes vim/vim#5503) https://github.com/vim/vim/commit/ed5adff1e6da412732514d82363005f85fe22e04 --- src/nvim/testdir/test_source.vim | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_source.vim b/src/nvim/testdir/test_source.vim index a5f5d1fd89..b8fe8422b3 100644 --- a/src/nvim/testdir/test_source.vim +++ b/src/nvim/testdir/test_source.vim @@ -50,7 +50,6 @@ endfunc " When deleting a file and immediately creating a new one the inode may be " recycled. Vim should not recognize it as the same script. func Test_different_script() - call ch_logfile('logfile', 'w') call writefile(['let s:var = "asdf"'], 'XoneScript') source XoneScript call delete('XoneScript') -- cgit