Skip to content

Commit

Permalink
Tighten match of comment preceding recipe body
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed Oct 17, 2024
1 parent 41e3b58 commit c11e414
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 @@ -24,7 +24,7 @@ syn match justShebang "^\s*#!.*$" contains=justInterpolation,@justOtherCurlyBrac
syn match justName "\h\k*" contained
syn match justFunction "\h\k*" contained

syn match justPreBodyComment "\v%(\s|\\\n)*#%([^!].*)?\n%(\t+| +)@=" transparent contained contains=justComment
syn match justPreBodyComment "\v%(\s|\\\n)*%([^\\]\n)@3<!#%([^!].*)?\n%(\t+| +)@=" transparent contained contains=justComment
\ nextgroup=@justBodies skipnl

syn region justBacktick start=/`/ end=/`/
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/invalid.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@

<span class="Type">[script</span><span class="Operator">:</span> <span class="String">'bash'</span><span class="Operator">,</span> "-x"<span class="Operator">,</span> '-c'<span class="Type">]</span>
<span class="Function">attr-shorthand-takes-only-one-argument</span><span class="Operator">:</span>


<span class="Function">recipe-without-body</span><span class="Operator">:</span>
<span class="Comment"># comment</span>
&Tab;echo this line is not recipe body
5 changes: 5 additions & 0 deletions tests/cases/invalid.just
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ comma-is-not-invalid-attr-value:

[script: 'bash', "-x", '-c']
attr-shorthand-takes-only-one-argument:


recipe-without-body:
# comment
echo this line is not recipe body

0 comments on commit c11e414

Please sign in to comment.