From 76fb19192a1f0e4fa875957333b3aff427edb2c2 Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Wed, 6 Mar 2019 07:18:10 +0100 Subject: [PATCH] Fix syntax highlighting for `case` The keyword `case` wouldn't get highlighted properly when there was any non-whitespace character on the same line before it. Often `elm-format` puts `case` on a new line, but not always, for example: ``` view x = div [] (case x of [] -> text "foo" _ -> text "bar" ) ``` --- syntax/elm.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/elm.vim b/syntax/elm.vim index be23595..24768dd 100644 --- a/syntax/elm.vim +++ b/syntax/elm.vim @@ -46,7 +46,7 @@ syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\ " Folding syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold syn region elmTopLevelFunction start="^[a-zA-Z].\+\n[a-zA-Z].\+=" end="^\(\n\+\)\@=" contains=ALL fold -syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold +syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="\" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\" end="\" contains=ALL fold