Browse Source

Fix behaviour of b:python_version_2 variable

Dmitry Vasiliev 10 years ago
parent
commit
e344f212b6
3 changed files with 13 additions and 4 deletions
  1. 4
    0
      CHANGES.txt
  2. 1
    0
      README.rst
  3. 8
    4
      syntax/python.vim

+ 4
- 0
CHANGES.txt View File

@@ -1,3 +1,7 @@
1
+Revision 3.3.2 (2013-06-01):
2
+
3
+   - Fixed behaviour of b:python_version_2 variable. Reported by Will Gray.
4
+
1 5
 Revision 3.3.1 (2013-05-12):
2 6
 
3 7
    - The script was moved to its own repository at

+ 1
- 0
README.rst View File

@@ -133,3 +133,4 @@ Contributors
133 133
 - Andrea Riciputi
134 134
 - Anton Butanaev
135 135
 - Marc Weber
136
+- Will Gray

+ 8
- 4
syntax/python.vim View File

@@ -2,9 +2,9 @@
2 2
 " Language:     Python
3 3
 " Maintainer:   Dmitry Vasiliev <dima at hlabs dot org>
4 4
 " URL:          https://github.com/hdima/python-syntax
5
-" Last Change:  2013-05-12
5
+" Last Change:  2013-06-01
6 6
 " Filenames:    *.py
7
-" Version:      3.3.1
7
+" Version:      3.3.2
8 8
 "
9 9
 " Based on python.vim (from Vim 6.1 distribution)
10 10
 " by Neil Schemenauer <nas at python dot ca>
@@ -27,6 +27,7 @@
27 27
 "   Andrea Riciputi
28 28
 "   Anton Butanaev
29 29
 "   Marc Weber
30
+"   Will Gray
30 31
 "
31 32
 " Options
32 33
 " =======
@@ -99,12 +100,15 @@ endfunction
99 100
 
100 101
 " Check if option is enabled
101 102
 function! s:Enabled(name)
102
-  return exists(a:name) && {a:name} != 0
103
+  return exists(a:name) && {a:name}
103 104
 endfunction
104 105
 
105 106
 " Is it Python 2 syntax?
106 107
 function! s:Python2Syntax()
107
-  return s:Enabled("b:python_version_2") || s:Enabled("g:python_version_2")
108
+  if exists("b:python_version_2")
109
+      return b:python_version_2
110
+  endif
111
+  return s:Enabled("g:python_version_2")
108 112
 endfunction
109 113
 
110 114
 "