]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(qml): Add optional chaining to QML syntax master
authorii14 <ii14@users.noreply.github.com>
Tue, 28 Apr 2026 21:20:41 +0000 (21:20 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 28 Apr 2026 21:20:41 +0000 (21:20 +0000)
"obj?.prop" was wrongly parsed as ternary operator.

closes: #19988

Signed-off-by: ii14 <ii14@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/qml.vim

index d6f2abec373813d5114c685551f0f9f3b39b6402..e395d83c2ab46f17727a042d59fcc708d9301a74 100644 (file)
@@ -4,6 +4,7 @@
 " Maintainer:   Chase Knowlden <haroldknowlden@gmail.com>
 " Changes:      `git log` is your friend
 " Last Change:  2023 Aug 16
+" 2026 Apr 16 by Vim project: handle ?. optional chaining #19988
 "
 " This file is bassed on the original work done by Warwick Allison
 " <warwick.allison@nokia.com> whose did about 99% of the work here.
@@ -44,6 +45,7 @@ syn match   qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
 syn region  qmlTernaryColon   start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens,qmlLineComment
 syn match   qmlBindingProperty   "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
 syn match  qmlNullishCoalescing    "??"
+syn match   qmlOptionalChaining  "?\."
 
 syn keyword qmlConditional       if else switch
 syn keyword qmlRepeat            while for do in