From fcf7242b82574f3131481b8143cedce8c1dc3298 Mon Sep 17 00:00:00 2001 From: Adam Sapek Date: Fri, 7 Aug 2015 12:42:24 -0700 Subject: [PATCH] Add highlighting for identifiers in nested scope Defined `hsIdentifierNested` syntax highlighting item for identifiers defined in `where` clause. It matches identifier preceded by whitespaces when it is followed by = on the same line or the next line starting with whitespace preceded |. The = is not considered when it is within {} to handle syntax like: Foo {foo = bar} <- action or foo (\x -> x {foo = bar}) By default `hsIdentifierNested` is highlighted as `Identifier` but it is a distinct item from `hsIdentifier` to allow not highlighting it or using a different color than for top level identifiers. --- autoload/vim2hs/haskell/syntax.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/vim2hs/haskell/syntax.vim b/autoload/vim2hs/haskell/syntax.vim index d226cc4..7e276a6 100644 --- a/autoload/vim2hs/haskell/syntax.vim +++ b/autoload/vim2hs/haskell/syntax.vim @@ -114,7 +114,11 @@ function! vim2hs#haskell#syntax#bindings() " {{{ syntax match hsIdentifier \ "^\k\+\ze.*\%(\n\s.*\|\n\)*[[:punct:]]\@