diff --git a/runtime/syntax/django.vim b/runtime/syntax/django.vim index 5b677063c1..0d0c11b510 100644 --- a/runtime/syntax/django.vim +++ b/runtime/syntax/django.vim @@ -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"