Skip to content

Commit e027b31

Browse files
committed
add support for deriving strategies
1 parent 430b529 commit e027b31

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

indent/haskell.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function! GetHaskellIndent()
318318

319319
" newtype Foo = Foo
320320
" >>deriving
321-
if l:prevline =~ '\C\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\<deriving\>'
321+
if l:prevline =~ '\C^\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\<deriving\>'
322322
return match(l:prevline, '\S') + &shiftwidth
323323
endif
324324

syntax/haskell.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ syn match haskellTypeSig
3636
\ haskellParens
3737
syn keyword haskellWhere where
3838
syn keyword haskellLet let
39-
syn keyword haskellDeclKeyword module class instance newtype deriving in
39+
syn match HaskellDerive "\<deriving\>\s\+\<\(anyclass\|instance\|newtype\|stock\)\?"
40+
syn keyword haskellDeclKeyword module class instance newtype in
4041
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
4142
syn keyword haskellDefault default
4243
syn keyword haskellImportKeywords import qualified safe as hiding contained
@@ -159,11 +160,13 @@ highlight def link haskellType Type
159160
highlight def link haskellImportKeywords Include
160161
if get(g:, 'haskell_classic_highlighting', 0)
161162
highlight def link haskellDeclKeyword Keyword
163+
highlight def link HaskellDerive Keyword
162164
highlight def link haskellDecl Keyword
163165
highlight def link haskellWhere Keyword
164166
highlight def link haskellLet Keyword
165167
else
166168
highlight def link haskellDeclKeyword Structure
169+
highlight def link HaskellDerive Structure
167170
highlight def link haskellDecl Structure
168171
highlight def link haskellWhere Structure
169172
highlight def link haskellLet Structure

0 commit comments

Comments
 (0)