1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0950
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
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 ///
|