From 7276b1c0ba6fec576bc2d43fa3212a5e27a606c8 Mon Sep 17 00:00:00 2001 From: lfmet Date: Fri, 15 Sep 2017 14:55:24 -0300 Subject: [PATCH 1/3] Add support to `if` shorthand --- syntax/pico8.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax/pico8.vim b/syntax/pico8.vim index 42de77d..03ae1fa 100644 --- a/syntax/pico8.vim +++ b/syntax/pico8.vim @@ -49,7 +49,8 @@ syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>" syn region luaFunctionBlock transparent matchgroup=luaFunction start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat " if then else elseif end -syn keyword luaCond contained else +syn keyword luaCond contained else +syn keyword luaCondSh contained if " then ... end syn region luaCondEnd contained transparent matchgroup=luaCond start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaRepeat @@ -153,6 +154,7 @@ if version >= 508 || !exists("did_lua_syntax_inits") HiLink luaOperator Operator HiLink luaConstant Constant HiLink luaCond Conditional + HiLink luaCondSh Conditional HiLink luaFunction Function HiLink luaComment Comment HiLink luaTodo Todo From 34bbce861873f68892ff85bc0558723c0625a885 Mon Sep 17 00:00:00 2001 From: lfmet Date: Fri, 15 Sep 2017 16:32:08 -0300 Subject: [PATCH 2/3] Merge luaCond keywords --- syntax/pico8.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/syntax/pico8.vim b/syntax/pico8.vim index 03ae1fa..2fc19f0 100644 --- a/syntax/pico8.vim +++ b/syntax/pico8.vim @@ -49,8 +49,7 @@ syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>" syn region luaFunctionBlock transparent matchgroup=luaFunction start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat " if then else elseif end -syn keyword luaCond contained else -syn keyword luaCondSh contained if +syn keyword luaCond contained else if " then ... end syn region luaCondEnd contained transparent matchgroup=luaCond start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaRepeat @@ -154,7 +153,6 @@ if version >= 508 || !exists("did_lua_syntax_inits") HiLink luaOperator Operator HiLink luaConstant Constant HiLink luaCond Conditional - HiLink luaCondSh Conditional HiLink luaFunction Function HiLink luaComment Comment HiLink luaTodo Todo From 5d03e65d2ad837c30c9c2ab6a8bd2ec916269968 Mon Sep 17 00:00:00 2001 From: lfmet Date: Fri, 15 Sep 2017 16:51:37 -0300 Subject: [PATCH 3/3] Change ALLBUT,... to ALL on luaFunctionBlock --- syntax/pico8.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/pico8.vim b/syntax/pico8.vim index 2fc19f0..143cab3 100644 --- a/syntax/pico8.vim +++ b/syntax/pico8.vim @@ -46,7 +46,7 @@ syn match luaError "}" syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>" " Function declaration -syn region luaFunctionBlock transparent matchgroup=luaFunction start="\" end="\" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat +syn region luaFunctionBlock transparent matchgroup=luaFunction start="\" end="\" contains=ALL " if then else elseif end syn keyword luaCond contained else if