Skip to content

separate pythonClassName from pythonFunction #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion syntax/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if s:Enabled('g:python_highlight_all')
call s:EnableByDefault('g:python_highlight_space_errors')
call s:EnableByDefault('g:python_highlight_doctests')
call s:EnableByDefault('g:python_print_as_function')
call s:EnableByDefault('g:python_highlight_class_names')
call s:EnableByDefault('g:python_highlight_class_vars')
call s:EnableByDefault('g:python_highlight_operators')
endif
Expand All @@ -63,7 +64,11 @@ endif

syn keyword pythonStatement break continue del return pass yield global assert lambda with
syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
syn keyword pythonStatement def nextgroup=pythonFunction skipwhite
if s:Enabled('g:python_highlight_class_names')
syn keyword pythonStatement class nextgroup=pythonClassName skipwhite
syn match pythonClassName '\%([[:upper:]][^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained
endif
if s:Enabled('g:python_highlight_class_vars')
syn keyword pythonClassVar self cls
endif
Expand Down Expand Up @@ -407,6 +412,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
HiLink pythonRaiseFromStatement Statement
HiLink pythonImport Include
HiLink pythonFunction Function
HiLink pythonClassName Structure
HiLink pythonConditional Conditional
HiLink pythonRepeat Repeat
HiLink pythonException Exception
Expand Down
3 changes: 3 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

def functionname
class Classname
class classname
def функция
class Класс
class класс


# Keywords: Python 2

Expand Down