Skip to content

Commit

Permalink
Fix highlighting of export assignments with line continuations
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed Aug 6, 2024
1 parent 00170c0 commit 907ff68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ syn match justAliasDecl "\v^alias%(\s|\\\n)+\h\k*%(\s|\\\n)*:\=%(\s|\\\n)*"
\ nextgroup=justAliasRes
syn match justAliasRes '\v\h\k*%(\s|\\\n)*%(#@=|$)' contained transparent contains=justFunction

syn match justExportedAssignment "\v^export%(\s|\\\n)+\h\k*\s*:\=" transparent
syn match justExportedAssignment "\v^export%(\s|\\\n)+\h\k*%(\s|\\\n)*:\=" transparent
\ contains=justExport,justAssignmentOperator

syn match justExport '\v^export' contained
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/line-continuations.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<span class="Special">\</span>
)

<span class="Statement">export</span> <span class="Special">\</span>
FOO_ENV <span class="Special">\</span>
<span class="Operator">:=</span> <span class="Special">\</span>
<span class="String">"FOO"</span>

<span class="Function">test</span><span class="Operator">:</span> <span class="Function">a</span> <span class="Special">\</span>
&Tab;<span class="Function">b</span>
<span class="Number">&Tab;echo </span><span class="String">'123'</span>
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/line-continuations.just
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ f3 := replace_regex \
\
)

export \
FOO_ENV \
:= \
"FOO"

test: a \
b
echo '123'
Expand Down

0 comments on commit 907ff68

Please sign in to comment.