From dd025a18c19d5a1a94777d49dc1a18c7ad82473d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 30 Aug 2019 16:43:21 +0200 Subject: vim-patch:8.1.0950: using :python sets 'pyxversion' even when not executed (#10891) Problem: Using :python sets 'pyxversion' even when not executed. Solution: Check the "skip" flag. (Shane Harper, closes vim/vim#3995) https://github.com/vim/vim/commit/14816ad6e58336773443f5ee2e4aa9e384af65d2 --- src/nvim/testdir/test_python2.vim | 8 ++++++++ src/nvim/testdir/test_python3.vim | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_python2.vim b/src/nvim/testdir/test_python2.vim index 7821078045..647290e6b5 100644 --- a/src/nvim/testdir/test_python2.vim +++ b/src/nvim/testdir/test_python2.vim @@ -67,6 +67,14 @@ func Test_vim_function() delfunc s:foo endfunc +func Test_skipped_python_command_does_not_affect_pyxversion() + set pyxversion=0 + if 0 + python import vim + endif + call assert_equal(0, &pyxversion) " This assertion would have failed with Vim 8.0.0251. (pyxversion was introduced in 8.0.0251.) +endfunc + func _SetUpHiddenBuffer() py import vim new diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index f1e8b25454..26aaab31ed 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -67,6 +67,14 @@ func Test_vim_function() delfunc s:foo endfunc +func Test_skipped_python3_command_does_not_affect_pyxversion() + set pyxversion=0 + if 0 + python3 import vim + endif + call assert_equal(0, &pyxversion) " This assertion would have failed with Vim 8.0.0251. (pyxversion was introduced in 8.0.0251.) +endfunc + func _SetUpHiddenBuffer() py3 import vim new -- cgit