From 80ccc835d27724868f392da67030857228f29842 Mon Sep 17 00:00:00 2001 From: takenoko Date: Mon, 30 Apr 2018 00:06:09 +0900 Subject: [PATCH] Add an option to disable double indent --- autoload/vim2hs/haskell/editing.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/autoload/vim2hs/haskell/editing.vim b/autoload/vim2hs/haskell/editing.vim index 07e10d7..2f7f887 100644 --- a/autoload/vim2hs/haskell/editing.vim +++ b/autoload/vim2hs/haskell/editing.vim @@ -18,13 +18,21 @@ function! vim2hs#haskell#editing#indentexpr(lnum) " {{{ let l:indent = match(l:line, '=') elseif l:line =~# '^data\>[^=]\+\|^class\>\|^instance\>' - let l:indent = &shiftwidth * 2 + if get(g:, "haskell_indent_double", 1) + let l:indent = &shiftwidth * 2 + else + let l:indent = &shiftwidth + end elseif l:line =~# '^newtype\>.*=.\+' let l:indent = match(l:line, '=') + 2 elseif l:line =~# '^\k\+.*=\s*\%(do\)\?$' - let l:indent = &shiftwidth * 2 + if get(g:, "haskell_indent_double", 1) + let l:indent = &shiftwidth * 2 + else + let l:indent = &shiftwidth + end elseif l:line =~# '\[[^\]]*$' let l:indent = match(l:line, '\[')