~sircmpwn/hare.vim

0bdef854f8531747438f7764cf7553ba16e56fb8 — Amelia Clarke 1 year, 3 months ago 63ace8b
syntax: improve use statement

Use statements are now highlighted correctly in all cases, including
when there is leading whitespace or when they take up multiple lines,
including comments inside.

Signed-off-by: Amelia Clarke <me@rsaihe.dev>
1 files changed, 4 insertions(+), 2 deletions(-)

M syntax/hare.vim
M syntax/hare.vim => syntax/hare.vim +4 -2
@@ 90,7 90,9 @@ syn match hareType "\v<size>((\_s*//.*\_$)*\_s*\()@!" contains=hareComment
syn match hareSpaceError "\v\s+$" display excludenl
syn match hareSpaceError "\v\zs +\ze\t" display

syn match harePreProc "^use .*;"
" Use statement.
syn region hareUse start="\v^\s*\zsuse>" end=";" contains=hareComment display

syn match hareErrorAssertion "\v(^([^/]|//@!)*\)\_s*)@<=!\=@!"
syn match hareQuestionMark "?"



@@ 109,7 111,6 @@ hi def link hareLabel Label
hi def link hareNull Constant
hi def link hareNumber Number
hi def link hareOperator Operator
hi def link harePreProc PreProc
hi def link hareQuestionMark Special
hi def link hareRepeat Repeat
hi def link hareRune Character


@@ 119,6 120,7 @@ hi def link hareStructure Structure
hi def link hareTodo Todo
hi def link hareType Type
hi def link hareTypedef Typedef
hi def link hareUse PreProc

hi def link hareSpaceError Error
autocmd InsertEnter * hi link hareSpaceError NONE