From 3bb60a715379143a71eece80f99f488fe700aa27 Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Mon, 5 Aug 2024 11:39:34 -0400 Subject: [PATCH] Fix highlighting of dependencies with parameters where there are newlines without continuation between the opening parenthesis and the dependency name --- syntax/just.vim | 2 +- tests/cases/tricky.html | 10 +++++++++- tests/cases/tricky.just | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/syntax/just.vim b/syntax/just.vim index e9c0577..99c93fb 100644 --- a/syntax/just.vim +++ b/syntax/just.vim @@ -261,7 +261,7 @@ syn region justReplaceRegexCallInInterp syn match justParameterLineContinuation '\v%(\s|\\\n)*' contained nextgroup=justParameterError -syn match justRecipeDepParenName '\v%(\(%(\s|\\\n)*)@<=\h\k*' +syn match justRecipeDepParenName '\v%(\(\n?)@3<=%(\_s|\\\n)*\h\k*' \ transparent contained \ contains=justFunction diff --git a/tests/cases/tricky.html b/tests/cases/tricky.html index c35a3d8..f59f9f3 100644 --- a/tests/cases/tricky.html +++ b/tests/cases/tricky.html @@ -131,6 +131,14 @@ parenthesized_dep_param3: (multi \ ( '1' + '0' ) \ +) ( +functions2 valid_uuid) \ +( + + \ + + unexport + this_justfile ) skip-all-whitespace-lines1: @@ -159,7 +167,7 @@ unexport PARAM \ : - env | grep -P {{quote(PARAM)}} + -env | grep -P {{quote(PARAM)}} ignored-comments-in-recipe foo='Foo': echo recipe diff --git a/tests/cases/tricky.just b/tests/cases/tricky.just index 18cb5ab..f3d01a2 100644 --- a/tests/cases/tricky.just +++ b/tests/cases/tricky.just @@ -131,6 +131,14 @@ parenthesized_dep_param2 p: (invoke \ parenthesized_dep_param3: (multi \ ( '1' + '0' ) \ +) ( +functions2 valid_uuid) \ +( + + \ + + unexport + this_justfile ) skip-all-whitespace-lines1: @@ -159,7 +167,7 @@ not-shell-expanded-string2 _-x: (functions2 _-x"$HOME") unexport PARAM \ : - env | grep -P {{quote(PARAM)}} + -env | grep -P {{quote(PARAM)}} ignored-comments-in-recipe foo='Foo': echo recipe