Skip to content

Commit 7ebaed4

Browse files
committed
Add indentation disabling configuration variable
1 parent e6f3093 commit 7ebaed4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

indent/haskell.vim

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ endif
1313

1414
let b:did_indent = 1
1515

16+
if !exists('g:haskell_indent_disable')
17+
let g:haskell_indent_disable = 0
18+
endif
19+
1620
if !exists('g:haskell_indent_if')
1721
" if x
1822
" >>>then ...
@@ -57,8 +61,14 @@ if !exists('g:haskell_indent_guard')
5761
let g:haskell_indent_guard = 2
5862
endif
5963

60-
setlocal indentexpr=GetHaskellIndent()
61-
setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,<space>
64+
if exists("g:haskell_indent_disable") && g:haskell_indent_disable == 0
65+
setlocal indentexpr=GetHaskellIndent()
66+
setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,<space>
67+
else
68+
setlocal nocindent
69+
setlocal nosmartindent
70+
setlocal autoindent
71+
endif
6272

6373
function! s:isInBlock(hlstack)
6474
return index(a:hlstack, 'haskellParens') > -1 || index(a:hlstack, 'haskellBrackets') > -1 || index(a:hlstack, 'haskellBlock') > -1 || index(a:hlstack, 'haskellBlockComment') > -1 || index(a:hlstack, 'haskellPragma') > -1

0 commit comments

Comments
 (0)