Skip to content

Commit

Permalink
Fix highlighting of dependencies with parameters where there are newl…
Browse files Browse the repository at this point in the history
…ines without continuation between the opening parenthesis and the dependency name
  • Loading branch information
laniakea64 committed Aug 5, 2024
1 parent b376fb4 commit 3bb60a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 9 additions & 1 deletion tests/cases/tricky.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@

<span class="Function">parenthesized_dep_param3</span><span class="Operator">:</span> <span class="Delimiter">(</span><span class="Function">multi</span> <span class="Special">\</span>
( <span class="String">'1'</span> <span class="Operator">+</span> <span class="String">'0'</span> ) <span class="Special">\</span>
<span class="Delimiter">)</span> <span class="Delimiter">(</span>
<span class="Function">functions2</span> valid_uuid<span class="Delimiter">)</span> <span class="Special">\</span>
<span class="Delimiter">(</span>

&Tab;<span class="Special">\</span>

<span class="Function">unexport</span>
this_justfile
<span class="Delimiter">)</span>

<span class="Function">skip-all-whitespace-lines1</span><span class="Operator">:</span>
Expand Down Expand Up @@ -159,7 +167,7 @@

<span class="Function">unexport</span> <span class="Identifier">PARAM</span> <span class="Special">\</span>
<span class="Operator">:</span>
<span class="Number">&Tab;env | grep -P </span><span class="Delimiter">{{</span><span class="Function">quote</span><span class="Normal">(</span><span class="Identifier">PARAM</span><span class="Normal">)</span><span class="Delimiter">}}</span>
<span class="Number">&Tab;</span><span class="Special">-</span><span class="Number">env | grep -P </span><span class="Delimiter">{{</span><span class="Function">quote</span><span class="Normal">(</span><span class="Identifier">PARAM</span><span class="Normal">)</span><span class="Delimiter">}}</span>

<span class="Function">ignored-comments-in-recipe</span> <span class="Identifier">foo</span><span class="Operator">=</span><span class="String">'Foo'</span><span class="Operator">:</span>
<span class="Number">&Tab;echo recipe</span>
Expand Down
10 changes: 9 additions & 1 deletion tests/cases/tricky.just
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3bb60a7

Please sign in to comment.