Skip to content

Commit

Permalink
Ensure required Vim syntaxes are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pbnj and laniakea64 committed Feb 2, 2025
1 parent e0978aa commit d3538e1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ endif

let b:current_syntax = 'just'

" Ensure the Vim syntaxes required by this file are enabled.
" Setting and restoring 'cpoptions' is documented not to have side effects,
" so this does not need to be conditionally gated.
let s:cpo_save = &cpo
set cpo&vim

" syncing fromstart prevents mismatched highlighting when jumping around in a justfile
" linebreaks= keeps multi-line constructs highlighted correctly while typing
syn sync fromstart linebreaks=10
Expand Down Expand Up @@ -320,6 +326,10 @@ syn match justModStatement '^mod' contained

syn match justOptionalFile '\V?' contained


let &cpo = s:cpo_save
unlet s:cpo_save

" Most linked colorscheme colors are chosen based on semantics of the color name.
" Some are for parity with other syntax files (for example, Number for recipe body highlighting
" is to align with the make.vim distributed with Vim).
Expand All @@ -330,7 +340,8 @@ syn match justOptionalFile '\V?' contained
"
" Note that vim-just's highlight groups are an implementation detail and may be subject to change.

" The list of highlight links is sorted alphabetically.
" The list of highlight links is sorted alphabetically,
" and is placed at the very end of the file to simplify keeping it sorted.

hi def link justAlias Statement
hi def link justAssignmentOperator Operator
Expand Down

0 comments on commit d3538e1

Please sign in to comment.