Skip to content
Merged
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
4 changes: 4 additions & 0 deletions doc/pymode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ Highlight "print" as a function *'g:pymode_syntax_print_as_function'*
>
let g:pymode_syntax_print_as_function = 0

Highlight "async/await" keywords *'g:pymode_syntax_highlight_async_await'*
>
let g:pymode_syntax_highlight_async_await = g:pymode_syntax_all

Highlight '=' operator *'g:pymode_syntax_highlight_equal_operator'*
>
let g:pymode_syntax_highlight_equal_operator = g:pymode_syntax_all
Expand Down
10 changes: 10 additions & 0 deletions syntax/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ call pymode#default('g:pymode_syntax_all', 1)

" Highlight 'print' as function
call pymode#default("g:pymode_syntax_print_as_function", 0)
"
" Highlight 'async/await' keywords
call pymode#default("g:pymode_syntax_highlight_async_await", g:pymode_syntax_all)

" Highlight '=' operator
call pymode#default('g:pymode_syntax_highlight_equal_operator', g:pymode_syntax_all)
Expand Down Expand Up @@ -101,6 +104,13 @@ endif
syn keyword pythonStatement print
endif

if g:pymode_syntax_highlight_async_await
syn keyword pythonStatement async await
syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
syn match pythonStatement "\<async\s\+with\>" display
syn match pythonStatement "\<async\s\+for\>" nextgroup=pythonRepeat skipwhite
endif

if g:pymode_syntax_highlight_equal_operator
syn match pythonExtraOperator "\%(=\)"
endif
Expand Down
1 change: 1 addition & 0 deletions t/syntax.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe 'pymode-syntax'
Expect g:pymode_syntax == 1
Expect g:pymode_syntax_all == 1
Expect g:pymode_syntax_print_as_function == 0
Expect g:pymode_syntax_highlight_async_await == 1
Expect g:pymode_syntax_highlight_equal_operator == 1
Expect g:pymode_syntax_highlight_stars_operator == 1
Expect g:pymode_syntax_highlight_self == 1
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy