summaryrefslogtreecommitdiffstats
path: root/indent/haskell.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2017-09-27 19:57:29 +0200
commit8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8 (patch)
tree125734ac66307a962eeda16283355dde0d0fbd2e /indent/haskell.vim
parent9bfde7574aa89a91b80ed9c993fc000cfc11aae7 (diff)
downloadvim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.tar.gz
vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.zip
Update
Diffstat (limited to 'indent/haskell.vim')
-rw-r--r--indent/haskell.vim19
1 files changed, 18 insertions, 1 deletions
diff --git a/indent/haskell.vim b/indent/haskell.vim
index e63515ce..5c33e550 100644
--- a/indent/haskell.vim
+++ b/indent/haskell.vim
@@ -36,9 +36,18 @@ endif
if !exists('g:haskell_indent_let')
" let x = 0 in
" >>>>x
+ "
+ " let x = 0
+ " y = 1
let g:haskell_indent_let = 4
endif
+if !exists('g:haskell_indent_let_no_in')
+ " let x = 0
+ " x
+ let g:haskell_indent_let_no_in = 4
+endif
+
if !exists('g:haskell_indent_where')
" where f :: Int -> Int
" >>>>>>f x = x
@@ -210,6 +219,9 @@ function! GetHaskellIndent()
"
" let x = 1
" >>>>y = 2
+ "
+ " let x = 1
+ " y 2
if l:prevline =~ '\C\<let\>\s\+.\+$'
if l:line =~ '\C^\s*\<let\>'
let l:s = match(l:prevline, '\C\<let\>')
@@ -221,11 +233,16 @@ function! GetHaskellIndent()
if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
return l:s + g:haskell_indent_in
endif
- else
+ elseif l:line =~ '\s=\s'
let l:s = match(l:prevline, '\C\<let\>')
if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
return l:s + g:haskell_indent_let
endif
+ else
+ let l:s = match(l:prevline, '\C\<let\>')
+ if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
+ return l:s + g:haskell_indent_let_no_in
+ endif
endif
endif