diff options
author | Hans Bolinder <[email protected]> | 2011-04-01 08:53:48 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2011-04-01 08:53:48 +0200 |
commit | f135c4e688dba07b42024295c1f111a106a0820c (patch) | |
tree | 3bf1795d93835d0c3406813e2733e895866957da /lib/syntax_tools | |
parent | 07307ef070010af9a2ba1d3fb0eeb969f5a9e847 (diff) | |
download | otp-f135c4e688dba07b42024295c1f111a106a0820c.tar.gz otp-f135c4e688dba07b42024295c1f111a106a0820c.tar.bz2 otp-f135c4e688dba07b42024295c1f111a106a0820c.zip |
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.
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r-- | lib/syntax_tools/src/erl_recomment.erl | 2 |
1 files changed, 1 insertions, 1 deletions
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)]; |