Browse Source

Fix behaviour of b:python_version_2 variable

Dmitry Vasiliev 11 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
+Revision 3.3.2 (2013-06-01):
2
+
3
+   - Fixed behaviour of b:python_version_2 variable. Reported by Will Gray.
4
+
1
 Revision 3.3.1 (2013-05-12):
5
 Revision 3.3.1 (2013-05-12):
2
 
6
 
3
    - The script was moved to its own repository at
7
    - The script was moved to its own repository at

+ 1
- 0
README.rst View File

133
 - Andrea Riciputi
133
 - Andrea Riciputi
134
 - Anton Butanaev
134
 - Anton Butanaev
135
 - Marc Weber
135
 - Marc Weber
136
+- Will Gray

+ 8
- 4
syntax/python.vim View File

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