1
0
mirror of https://github.com/gryf/python-syntax.git synced 2025-12-19 12:28:13 +01:00

4 Commits

Author SHA1 Message Date
Dmitry Vasiliev
ebbdd093b7 Revision 3.3.3 2013-06-02 13:52:27 +02:00
Will Gray
fc6a66bf80 Reload local syntax only
Turning syntax off and back on is more than what's necessary to reload the syntax for the current buffer.
2013-06-01 14:53:27 -05:00
Dmitry Vasiliev
e344f212b6 Fix behaviour of b:python_version_2 variable 2013-06-01 17:18:56 +02:00
Dmitry Vasiliev
91eaa32bea Update CHANGES.txt 2013-05-12 22:30:15 +02:00
3 changed files with 36 additions and 14 deletions

View File

@@ -1,3 +1,16 @@
Revision 3.3.3 (2013-06-02):
- More lightweight syntax reloading. Patch by Will Gray.
Revision 3.3.2 (2013-06-01):
- Fixed behaviour of b:python_version_2 variable. Reported by Will Gray.
Revision 3.3.1 (2013-05-12):
- The script was moved to its own repository at
https://github.com/hdima/python-syntax
Revision 3.3.0 (2013-03-10): Revision 3.3.0 (2013-03-10):
- Merge Python 2 and Python 3 script versions into the single python.vim - Merge Python 2 and Python 3 script versions into the single python.vim

View File

@@ -126,10 +126,13 @@ Options used by the script
Contributors Contributors
------------ ------------
- Jeroen Ruigrok van der Werven List of the contributors in alphabetical order:
- Pedro Algarvio
- John Eikenberry
- Caleb Adamantine
- Andrea Riciputi - Andrea Riciputi
- Anton Butanaev - Anton Butanaev
- Caleb Adamantine
- Jeroen Ruigrok van der Werven
- John Eikenberry
- Marc Weber - Marc Weber
- Pedro Algarvio
- Will Gray

View File

@@ -2,9 +2,9 @@
" Language: Python " Language: Python
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org> " Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
" URL: https://github.com/hdima/python-syntax " URL: https://github.com/hdima/python-syntax
" Last Change: 2013-05-12 " Last Change: 2013-06-02
" Filenames: *.py " Filenames: *.py
" Version: 3.3.1 " Version: 3.3.3
" "
" Based on python.vim (from Vim 6.1 distribution) " Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <nas at python dot ca> " by Neil Schemenauer <nas at python dot ca>
@@ -20,13 +20,16 @@
" Contributors " Contributors
" ============ " ============
" "
" Jeroen Ruigrok van der Werven " List of the contributors in alphabetical order:
" Pedro Algarvio "
" John Eikenberry
" Caleb Adamantine
" Andrea Riciputi " Andrea Riciputi
" Anton Butanaev " Anton Butanaev
" Caleb Adamantine
" Jeroen Ruigrok van der Werven
" John Eikenberry
" Marc Weber " Marc Weber
" Pedro Algarvio
" Will Gray
" "
" Options " Options
" ======= " =======
@@ -87,8 +90,8 @@ endif
" "
" Commands " Commands
" "
command! -buffer Python2Syntax let b:python_version_2 = 1 | if exists("g:syntax_on") | syn off | endif | syn enable command! -buffer Python2Syntax let b:python_version_2 = 1 | let &syntax=&syntax
command! -buffer Python3Syntax let b:python_version_2 = 0 | if exists("g:syntax_on") | syn off | endif | syn enable command! -buffer Python3Syntax let b:python_version_2 = 0 | let &syntax=&syntax
" Enable option if it's not defined " Enable option if it's not defined
function! s:EnableByDefault(name) function! s:EnableByDefault(name)
@@ -99,12 +102,15 @@ endfunction
" Check if option is enabled " Check if option is enabled
function! s:Enabled(name) function! s:Enabled(name)
return exists(a:name) && {a:name} != 0 return exists(a:name) && {a:name}
endfunction endfunction
" Is it Python 2 syntax? " Is it Python 2 syntax?
function! s:Python2Syntax() function! s:Python2Syntax()
return s:Enabled("b:python_version_2") || s:Enabled("g:python_version_2") if exists("b:python_version_2")
return b:python_version_2
endif
return s:Enabled("g:python_version_2")
endfunction endfunction
" "