To: vim_dev@googlegroups.com Subject: Patch 8.1.0950 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0950 Problem: Using :python sets 'pyxversion' even when not executed. Solution: Check the "skip" flag. (Shane Harper, closes #3995) Files: src/if_python.c, src/if_python3.c, src/testdir/test_python2.vim, src/testdir/test_python3.vim *** ../vim-8.1.0949/src/if_python.c 2019-02-17 17:44:36.211875510 +0100 --- src/if_python.c 2019-02-18 22:03:51.645989786 +0100 *************** *** 1109,1120 **** { char_u *script; - if (p_pyx == 0) - p_pyx = 2; - script = script_get(eap, eap->arg); if (!eap->skip) { DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script, (rangeinitializer) init_range_cmd, (runner) run_cmd, --- 1109,1120 ---- { char_u *script; script = script_get(eap, eap->arg); if (!eap->skip) { + if (p_pyx == 0) + p_pyx = 2; + DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script, (rangeinitializer) init_range_cmd, (runner) run_cmd, *** ../vim-8.1.0949/src/if_python3.c 2019-02-17 17:44:36.211875510 +0100 --- src/if_python3.c 2019-02-18 22:03:59.553940718 +0100 *************** *** 1010,1021 **** { char_u *script; - if (p_pyx == 0) - p_pyx = 3; - script = script_get(eap, eap->arg); if (!eap->skip) { DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script, (rangeinitializer) init_range_cmd, (runner) run_cmd, --- 1010,1021 ---- { char_u *script; script = script_get(eap, eap->arg); if (!eap->skip) { + if (p_pyx == 0) + p_pyx = 3; + DoPyCommand(script == NULL ? (char *) eap->arg : (char *) script, (rangeinitializer) init_range_cmd, (runner) run_cmd, *** ../vim-8.1.0949/src/testdir/test_python2.vim 2018-12-22 18:59:00.790537016 +0100 --- src/testdir/test_python2.vim 2019-02-18 21:57:07.812473174 +0100 *************** *** 63,65 **** --- 63,73 ---- py del f 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 *** ../vim-8.1.0949/src/testdir/test_python3.vim 2018-12-22 18:59:00.790537016 +0100 --- src/testdir/test_python3.vim 2019-02-18 21:48:57.287378639 +0100 *************** *** 63,65 **** --- 63,73 ---- py3 del f 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 *** ../vim-8.1.0949/src/version.c 2019-02-18 21:41:34.477750367 +0100 --- src/version.c 2019-02-18 22:04:11.605865915 +0100 *************** *** 781,782 **** --- 781,784 ---- { /* Add new patch number below this line */ + /**/ + 950, /**/ -- Female engineers become irresistible at the age of consent and remain that way until about thirty minutes after their clinical death. Longer if it's a warm day. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///