summaryrefslogtreecommitdiffstats
path: root/indent/haskell.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-11-11 02:37:21 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2014-11-11 02:37:21 +0100
commit617b01a5b6aa3cadb25b2ff8639e330cfc6cf3c1 (patch)
tree97fc653e0c19839490bd7aac6beeb4f5754155be /indent/haskell.vim
parentbd35da8e9ca0bddd95539bef0c8f4857dc4cc746 (diff)
downloadvim-polyglot-617b01a5b6aa3cadb25b2ff8639e330cfc6cf3c1.tar.gz
vim-polyglot-617b01a5b6aa3cadb25b2ff8639e330cfc6cf3c1.zip
Updatev1.10.3
Diffstat (limited to 'indent/haskell.vim')
-rw-r--r--indent/haskell.vim10
1 files changed, 5 insertions, 5 deletions
diff --git a/indent/haskell.vim b/indent/haskell.vim
index 1d741032..1d500250 100644
--- a/indent/haskell.vim
+++ b/indent/haskell.vim
@@ -55,7 +55,7 @@ function! HIndent(lnum)
" This is the wrong thing if you are deeply indented already and want to put
" a where clause on the top-level construct, but there isn't much that can
" be done about that case...
- if thisl =~ '^\s*where\s*$'
+ if thisl =~ '^\s*where\s*'
return previ + &sw
endif
@@ -175,11 +175,11 @@ function! HIndent(lnum)
return previ - &sw
endif
- " On the other hand, if the previous line is a where with some bindings
+ " On the other hand, if the previous line is a do or where with some bindings
" following it on the same line, accommodate and align with the first non-ws
" char after the where
- if prevl =~ '\Wwhere\s\+\w'
- let bindStart = match(prevl, '\(\Wwhere\s\+\)\@<=\w')
+ if prevl =~ '\W\(do\|where\)\s\+\w'
+ let bindStart = match(prevl, '\(\W\(do\|where\)\s\+\)\@<=\w')
if bindStart != -1
return bindStart
endif
@@ -248,7 +248,7 @@ function! s:GetAndStripTrailingComments(lnum)
let aline = getline(a:lnum)
" We can't just remove the string literal since that leaves us with a
" trailing operator (=), so replace it with a fake identifier
- let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', 's', '')
+ let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', '\=repeat("s", len(submatch(0)))', '')
let noLineCom = substitute(noStrings, '--.*$', '', '')
" If there are no fancy block comments involved, skip some of this extra