runtime(context): don't match math region if $ is escaped

Commit: 
https://github.com/vim/vim/commit/f716326eefb14fd4c913bafb5292741a8cfc06f6
Author: Lifepillar <[email protected]>
Date:   Sat Jun 13 14:51:34 2026 +0000

    runtime(context): don't match math region if $ is escaped
    
    closes: https://github.com/vim/vim/issues/20509
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/syntax/context.vim b/runtime/syntax/context.vim
index 07b59c0fc..891d5c651 100644
--- a/runtime/syntax/context.vim
+++ b/runtime/syntax/context.vim
@@ -4,7 +4,7 @@ vim9script
 # Language:           ConTeXt typesetting engine
 # Maintainer:         Nicola Vitacolonna <[email protected]>
 # Former Maintainers: Nikolai Weibull <[email protected]>
-# Latest Revision:    2026 Jan 10
+# Latest Revision:    2026 Jun 13
 
 if exists("b:current_syntax")
   finish
@@ -60,7 +60,7 @@ syn match   contextSequence   
'\[a-zA-Z]*[@_!?]\+[a-zA-Z@_!?]*' contains=@NoSpe
 
 # Math
 syn match  contextMathCmd '\m\%(ath\%(ematics\)\=\)\=\>'
-syn region contextInlineMath matchgroup=contextMathDelim start='\$' 
skip='\\\|\\$' end='\$'
+syn region contextInlineMath matchgroup=contextMathDelim start='[\]\@1<!\$' 
skip='\\\|\\$' end='[\]\@1<!\$'
 syn region contextDisplayMath matchgroup=contextMathDelim start='\$\$' 
skip='\\\|\\$' end='\$\$' keepend
 syn region contextDisplayMath matchgroup=contextBlockDelim 
start='\startformula' end='\stopformula' contains=TOP
 
@@ -117,27 +117,28 @@ syn match   contextFont       
'\\%(Word\|WORD\|Words\|WORDS\)\>'
 syn match   contextFont       '\\%(vi\{1,3}\|ix\|xi\{0,2}\)\>'                 
contains=@NoSpell
 syn match   contextFont       '\\%(tf\|b[si]\|s[cl]\|os\)\%(xx\|[xabcd]\)\=\>' 
contains=@NoSpell
 
-hi def link contextBlockDelim Keyword
-hi def link contextBuiltin    Keyword
-hi def link contextCommand    Keyword
-hi def link contextComment    Comment
-hi def link contextDelimiter  Delimiter
-hi def link contextDirectLua  Keyword
-hi def link contextEscaped    String
-hi def link contextFont       contextType
-hi def link contextKeyword    Keyword
-hi def link contextInlineMath String
-hi def link contextMagicLine  PreProc
-hi def link contextMathCmd    Identifier
-hi def link contextMathDelim  Delimiter
-hi def link contextOptions    Typedef
-hi def link contextPreProc    PreProc
-hi def link contextSectioning PreProc
-hi def link contextSequence   Identifier
-hi def link contextSpecial    Special
-hi def link contextStyle      contextType
-hi def link contextTodo       Todo
-hi def link contextType       Type
+hi def link contextBlockDelim  Keyword
+hi def link contextBuiltin     Keyword
+hi def link contextCommand     Keyword
+hi def link contextComment     Comment
+hi def link contextDelimiter   Delimiter
+hi def link contextDirectLua   Keyword
+hi def link contextDisplayMath String
+hi def link contextEscaped     String
+hi def link contextFont        contextType
+hi def link contextKeyword     Keyword
+hi def link contextInlineMath  String
+hi def link contextMagicLine   PreProc
+hi def link contextMathCmd     Identifier
+hi def link contextMathDelim   Delimiter
+hi def link contextOptions     Typedef
+hi def link contextPreProc     PreProc
+hi def link contextSectioning  PreProc
+hi def link contextSequence    Identifier
+hi def link contextSpecial     Special
+hi def link contextStyle       contextType
+hi def link contextTodo        Todo
+hi def link contextType        Type
 
 b:current_syntax = 'context'
 

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wYPq9-00DAG2-SX%40256bit.org.

Raspunde prin e-mail lui