Skip to content

Commit

Permalink
Fix highlighting of inline comments after mod statements without ex…
Browse files Browse the repository at this point in the history
…plicit path
  • Loading branch information
laniakea64 committed Jul 7, 2024
1 parent bf30e6a commit 49d8d86
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 @@ -297,7 +297,7 @@ syn match justImportStatement '^import' contained

syn match justOldInclude "^!include"

syn match justModule /\v^mod%(%(\s|\\\n)*\?)?%(\s|\\\n)+\h\k*\s*%($|%(\s|\\\n)+%(x?['"])@=)/
syn match justModule /\v^mod%(%(\s|\\\n)*\?)?%(\s|\\\n)+\h\k*\s*%($|%(\s|\\\n)+%(x?['"])@=|%(\s|\\\n)*#@=)/
\ transparent contains=justModStatement,justName,justOptionalFile
syn match justModStatement '^mod' contained

Expand Down
5 changes: 5 additions & 0 deletions tests/cases/mod.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@

<span class="Keyword">mod</span> <span class="Identifier">foo</span> <span class="String">x'</span><span class="PreProc">$FOO</span><span class="String">/justfile'</span>
<span class="Keyword">mod</span><span class="Conditional">?</span> <span class="Identifier">foo</span> <span class="String">x"</span><span class="PreProc">$FOO</span><span class="String">/justfile"</span>

<span class="Keyword">mod</span> <span class="Identifier">foo</span> <span class="Comment"># comment</span>
<span class="Keyword">mod</span> <span class="Identifier">foo</span><span class="Comment">#comment</span>
<span class="Keyword">mod</span> <span class="Identifier">foo</span> <span class="Special">\</span>
<span class="Comment"># comment</span>
5 changes: 5 additions & 0 deletions tests/cases/mod.just
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ mod ? foo 'foo/justfile'

mod foo x'$FOO/justfile'
mod? foo x"$FOO/justfile"

mod foo # comment
mod foo#comment
mod foo \
# comment

0 comments on commit 49d8d86

Please sign in to comment.