Skip to content

Commit cae2990

Browse files
committed
syntax: Fix directives, subdirectives, and imports
1 parent 519ddfa commit cae2990

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/caddyfile.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ if exists("b:current_syntax")
66
finish
77
endif
88

9-
syn match caddyDirective "^\s*\([a-zA-Z0-9_]\+\)" nextgroup=caddyDirectiveArgs skipwhite
9+
syn match caddyDirective "\v^\s*(\w\S*)" nextgroup=caddyDirectiveArgs skipwhite
1010
syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher nextgroup=caddyDirectiveBlock skipwhite
1111
syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment,caddyImport
1212

13-
syn match caddySubdirective "^\s*\([a-zA-Z0-9_]\+\)" contained nextgroup=caddySubdirectiveArgs skipwhite
13+
syn match caddySubdirective "\v^\s*(\w\S*)" contained nextgroup=caddySubdirectiveArgs skipwhite
1414
syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher
1515

1616
" Needs priority over Directive
17-
syn match caddyImport "\v^\s*(import)" nextgroup=caddyImportPattern skipwhite
17+
syn match caddyImport "\v^\s*<import>" nextgroup=caddyImportPattern skipwhite
1818
syn match caddyImportPattern "\v\c\S+" contained nextgroup=caddyImportArgs skipwhite
1919
syn region caddyImportArgs start="" end="$"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher
2020

0 commit comments

Comments
 (0)