handle inline scripts better
This commit is contained in:
parent
9c5d746ec4
commit
4849640ef1
@ -13,7 +13,7 @@ def LogrotateHelp(msg: string = expand("<cword>"))
|
|||||||
gawk '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | gawk '
|
gawk '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | gawk '
|
||||||
/^ {7}%s/,/^[a-z]/ {
|
/^ {7}%s/,/^[a-z]/ {
|
||||||
if(firstLineDone) {
|
if(firstLineDone) {
|
||||||
if(/^ {7}[^ ]/ || /^[A-Z]/)
|
if(/^ {0,7}[^ ]/ && !/endscript/)
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
firstLineDone = 1
|
firstLineDone = 1
|
||||||
|
@ -6,6 +6,12 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
syn region logRotateScript matchgroup=logRotateKeyword start="\s*\<firstaction\>" end="\<endscript\>" contains=NONE
|
||||||
|
syn region logRotateScript matchgroup=logRotateKeyword start="\s*\<lastaction\>" end="\<endscript\>" contains=NONE
|
||||||
|
syn region logRotateScript matchgroup=logRotateKeyword start="\s*\<prerotate\>" end="\<endscript\>" contains=NONE
|
||||||
|
syn region logRotateScript matchgroup=logRotateKeyword start="\s*\<postrotate\>" end="\<endscript\>" contains=NONE
|
||||||
|
syn region logRotateScript matchgroup=logRotateKeyword start="\s*\<preremove\>" end="\<endscript\>" contains=NONE
|
||||||
|
|
||||||
runtime! syntax/conf.vim
|
runtime! syntax/conf.vim
|
||||||
|
|
||||||
" syn keyword logRotateTodo contained TODO FIXME XXX
|
" syn keyword logRotateTodo contained TODO FIXME XXX
|
||||||
@ -34,4 +40,6 @@ hi def link logRotateKeyword Keyword
|
|||||||
" hi def link logRotateComment Comment
|
" hi def link logRotateComment Comment
|
||||||
" hi def link logRotateTodo Todo
|
" hi def link logRotateTodo Todo
|
||||||
|
|
||||||
|
hi def link logRotateScript Function
|
||||||
|
|
||||||
let b:current_syntax = 'logrotate'
|
let b:current_syntax = 'logrotate'
|
||||||
|
Loading…
Reference in New Issue
Block a user