Skip to content

Commit e344f21

Browse files
committed
Fix behaviour of b:python_version_2 variable
1 parent 91eaa32 commit e344f21

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
15
Revision 3.3.1 (2013-05-12):
26

37
- The script was moved to its own repository at

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,4 @@ Contributors
133133
- Andrea Riciputi
134134
- Anton Butanaev
135135
- Marc Weber
136+
- Will Gray

syntax/python.vim

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
" Language: Python
33
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
44
" URL: https://github.com/hdima/python-syntax
5-
" Last Change: 2013-05-12
5+
" Last Change: 2013-06-01
66
" Filenames: *.py
7-
" Version: 3.3.1
7+
" Version: 3.3.2
88
"
99
" Based on python.vim (from Vim 6.1 distribution)
1010
" by Neil Schemenauer <nas at python dot ca>
@@ -27,6 +27,7 @@
2727
" Andrea Riciputi
2828
" Anton Butanaev
2929
" Marc Weber
30+
" Will Gray
3031
"
3132
" Options
3233
" =======
@@ -99,12 +100,15 @@ endfunction
99100

100101
" Check if option is enabled
101102
function! s:Enabled(name)
102-
return exists(a:name) && {a:name} != 0
103+
return exists(a:name) && {a:name}
103104
endfunction
104105

105106
" Is it Python 2 syntax?
106107
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")
108112
endfunction
109113

110114
"

0 commit comments

Comments
 (0)