From 716788b71602a81452cedc3206da45116b4d28b9 Mon Sep 17 00:00:00 2001 From: Justin Mayfield Date: Fri, 24 Mar 2023 15:42:54 -0600 Subject: [PATCH 1/2] My tweaks for async,await,this,yield and return --- syntax/javascript.vim | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 02b0c78c..388284b6 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -109,7 +109,9 @@ syntax keyword jsTry try skipwhite skipempty next syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsFinallyBlock syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch,jsTryCatchBlock syntax keyword jsException throw -syntax keyword jsAsyncKeyword async await +syntax keyword jsAsyncKeyword async +syntax keyword jsAwaitKeyword await +syntax keyword jsYieldKeyword yield syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock " Keywords @@ -236,7 +238,7 @@ if exists("javascript_plugin_flow") runtime extras/flow.vim endif -syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement,jsDot +syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsAwaitKeyword,jsYieldKeyword,jsStatement,jsDot syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsWhile,jsFor,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel,jsBlock " Define the default highlighting. @@ -278,18 +280,20 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsConditional Conditional HiLink jsBranch Conditional HiLink jsLabel Label - HiLink jsReturn Statement + HiLink jsReturn FunctionInterrupt + HiLink jsYield FunctionInterrupt HiLink jsWhile jsRepeat HiLink jsFor jsRepeat HiLink jsRepeat Repeat HiLink jsDo Repeat HiLink jsStatement Statement - HiLink jsException Exception + HiLink jsException FunctionInterrupt HiLink jsTry Exception HiLink jsFinally Exception HiLink jsCatch Exception - HiLink jsAsyncKeyword Keyword - HiLink jsForAwait Keyword + HiLink jsAsyncKeyword AsyncStatement + HiLink jsAwaitKeyword AwaitStatement + HiLink jsForAwait AwaitStatement HiLink jsArrowFunction Type HiLink jsFunction Type HiLink jsGenerator jsFunction @@ -307,7 +311,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsStorageClass StorageClass HiLink jsClassKeyword Keyword HiLink jsExtendsKeyword Keyword - HiLink jsThis Special + HiLink jsThis SelfIdent HiLink jsSuper Constant HiLink jsNan Number HiLink jsNull Type From 5f621a68398729ff0f747fa0163356f26aa26ee4 Mon Sep 17 00:00:00 2001 From: Justin Mayfield Date: Fri, 24 Mar 2023 16:22:02 -0600 Subject: [PATCH 2/2] Couple more mods --- syntax/javascript.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/javascript.vim b/syntax/javascript.vim index 388284b6..9b36189c 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -295,7 +295,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsAwaitKeyword AwaitStatement HiLink jsForAwait AwaitStatement HiLink jsArrowFunction Type - HiLink jsFunction Type + HiLink jsFunction FunctionStatement HiLink jsGenerator jsFunction HiLink jsArrowFuncArgs jsFuncArgs HiLink jsFuncName Function @@ -309,7 +309,7 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsOperator Operator HiLink jsOf Operator HiLink jsStorageClass StorageClass - HiLink jsClassKeyword Keyword + HiLink jsClassKeyword ClassStatement HiLink jsExtendsKeyword Keyword HiLink jsThis SelfIdent HiLink jsSuper Constant