Permalink
Browse files

Fixed indent when guard has ';'

  • Loading branch information...
1 parent bc42296 commit 5d5d4e5a9c7a56e3c0813d78f068fdaeb07ebd41 @kTT kTT committed Aug 30, 2010
Showing with 3 additions and 12 deletions.
  1. +0 −5 TODO
  2. +3 −7 indent/erlang.vim
View
5 TODO
@@ -3,8 +3,3 @@
+ I don't actually know what's not working or what's working but a note says it needs to be fixed
+ Folding one-line functions fails, i.e.:
fun(Args) -> body.
-* Fix indent a pattern followed by a guard with `;' because it fails, i.e.:
- receive
- foo when foo == foo; foo != bur ->
- ...
- ...
View
@@ -2,7 +2,8 @@
" Language: Erlang
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
" Contributor: Edwin Fine <efine145_nospam01 at usa dot net>
-" Last Change: 2008 Mar 12
+" Contributor: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
+" Last Change: 2010 Aug 30
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -90,7 +91,7 @@ function s:ErlangIndentAfterLine(l)
let m = i+2
let ind = ind + 1
let lastReceive = 0
- elseif a:l[i] == ';'
+ elseif a:l[i] == ';' && a:l[(i):(length)] !~# '.*->.*'
let m = i+1
let ind = ind - 1
let lastReceive = 0
@@ -199,8 +200,3 @@ endfunction
" #rec
" .field,
" bad_indent
-"
-" case X of
-" 1 when A; B ->
-" bad_indent
-

0 comments on commit 5d5d4e5

Please sign in to comment.