mirror of
https://github.com/neovim/neovim.git
synced 2026-05-26 14:58:28 +00:00
Merge pull request #39821 from zeertzjq/vim-8b25d90
vim-patch: django updates
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
" Last Change: 2021 Nov 29
|
||||
" 2026 Feb 12 by Vim Project add partial support #19386
|
||||
" 2026 Apr 17 by Vim Project Update to Django 5.2 version #19994
|
||||
" 2026 May 17 by Vim Project Update comparison operators #20225
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -18,8 +19,6 @@ syn match djangoError "%}\|}}\|#}"
|
||||
" Django template built-in tags and parameters
|
||||
" 'comment' doesn't appear here because it gets special treatment
|
||||
syn keyword djangoStatement contained autoescape csrf_token empty
|
||||
" FIXME ==, !=, <, >, <=, and >= should be djangoStatements:
|
||||
" syn keyword djangoStatement contained == != < > <= >=
|
||||
syn keyword djangoStatement contained and as block endblock by cycle debug else elif
|
||||
syn keyword djangoStatement contained extends filter endfilter firstof for
|
||||
syn keyword djangoStatement contained endfor if endif ifchanged endifchanged
|
||||
@@ -33,7 +32,9 @@ syn keyword djangoStatement contained get_current_language noop get_available_la
|
||||
syn keyword djangoStatement contained get_current_language_bidi get_language_info plural
|
||||
syn keyword djangoStatement contained translate blocktranslate endblocktranslate
|
||||
syn keyword djangoStatement contained partialdef endpartialdef partial
|
||||
syn keyword djangoStatement contained querystring lorem verbatim
|
||||
syn keyword djangoStatement contained querystring lorem verbatim localize endlocalize
|
||||
syn keyword djangoStatement contained localtime endlocaltime timezone endtimezone
|
||||
syn keyword djangoStatement contained get_current_timezone
|
||||
|
||||
" Django templete built-in filters
|
||||
syn keyword djangoFilter contained add addslashes capfirst center cut date
|
||||
@@ -49,6 +50,7 @@ syn keyword djangoFilter contained time timesince timeuntil title truncatechars
|
||||
syn keyword djangoFilter contained truncatewords truncatewords_html unordered_list upper urlencode
|
||||
syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno
|
||||
syn keyword djangoFilter contained force_escape iriencode json_script truncatechars_html
|
||||
syn keyword djangoFilter contained localize unlocalize localtime utc timezone
|
||||
|
||||
" Keywords to highlight within comments
|
||||
syn keyword djangoTodo contained TODO FIXME XXX
|
||||
@@ -68,6 +70,9 @@ syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgume
|
||||
syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo
|
||||
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo
|
||||
|
||||
" Match comparison operators within Django statements.
|
||||
syn match djangoOperator "==\|!=\|<=\|>=\|<\|>" contained containedin=djangoTagBlock
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
@@ -82,6 +87,6 @@ hi def link djangoError Error
|
||||
hi def link djangoComment Comment
|
||||
hi def link djangoComBlock Comment
|
||||
hi def link djangoTodo Todo
|
||||
|
||||
hi def link djangoOperator Operator
|
||||
|
||||
let b:current_syntax = "django"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
" Language: Django HTML template
|
||||
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
|
||||
" Last Change: 2014 Jul 13
|
||||
" 2026 May 17 by Vim Project Add highlighting for comparison operators #20232
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -23,4 +24,8 @@ syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgume
|
||||
syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
|
||||
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
|
||||
|
||||
" Use djangoTagBlockNaive to limit the djangoOperator matched characters to avoid spill-over with HTML, JS and CSS.
|
||||
syn region djangoTagBlockNaive start="{%" end="%}" contains=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock
|
||||
syn match djangoOperator "==\|!=\|<=\|>=\|<\|>" contained containedin=CONTAINS,@djangoTagBlockNaive
|
||||
|
||||
let b:current_syntax = "htmldjango"
|
||||
|
||||
Reference in New Issue
Block a user