indent deriving
This commit is contained in:
parent
61a5408ced
commit
44e3e6e137
1 changed files with 8 additions and 1 deletions
|
@ -48,7 +48,7 @@ if !exists('g:haskell_indent_do')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal indentexpr=GethaskellIndent()
|
setlocal indentexpr=GethaskellIndent()
|
||||||
setlocal indentkeys=!^F,o,O,},0=where,0=in,0=let,<CR>
|
setlocal indentkeys=!^F,o,O,},0=where,0=in,0=let,0=deriving,<CR>
|
||||||
|
|
||||||
function! GethaskellIndent()
|
function! GethaskellIndent()
|
||||||
let l:prevline = getline(v:lnum - 1)
|
let l:prevline = getline(v:lnum - 1)
|
||||||
|
@ -59,6 +59,13 @@ function! GethaskellIndent()
|
||||||
return l:s + 2
|
return l:s + 2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if l:line =~ '^\s*\<deriving\>'
|
||||||
|
let l:s = match(l:prevline, '\<\(newtype\|data\)\>')
|
||||||
|
if l:s >= 0
|
||||||
|
return l:s + 2
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if l:line =~ '^\s*\<let\>'
|
if l:line =~ '^\s*\<let\>'
|
||||||
let l:s = match(l:prevline, '\<let\>')
|
let l:s = match(l:prevline, '\<let\>')
|
||||||
if l:s != 0
|
if l:s != 0
|
||||||
|
|
Loading…
Reference in a new issue