From f135c4e688dba07b42024295c1f111a106a0820c Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Fri, 1 Apr 2011 08:53:48 +0200 Subject: Fix a bug in erl_recomment In a file containing declarations and comments without any empty lines between them, the recomment_forms() function would associate a multi-line comment with the declaration above it rather than the one following it. (Thanks to Richard Carlsson.) This bug has been reported several times. It was corrected by Kostis Sagonas, but the fix didn't make into the R14B02 release. --- lib/syntax_tools/src/erl_recomment.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/syntax_tools/src/erl_recomment.erl b/lib/syntax_tools/src/erl_recomment.erl index 919e9cfc5d..fc7c515700 100644 --- a/lib/syntax_tools/src/erl_recomment.erl +++ b/lib/syntax_tools/src/erl_recomment.erl @@ -163,7 +163,7 @@ recomment_forms_2(C, [N | Ns] = Nodes, Insert) -> Trailing = case Ns of [] -> true; - [Next | _] -> L < node_min(Next) - 2 + [Next | _] -> L + Delta < node_min(Next) - 2 end, if L > Max + 1 ; L =:= Max + 1, not Trailing -> [N | recomment_forms_2(C, Ns, Insert)]; -- cgit v1.2.3