anchor.diff:  	 end,
       append_clause_body(B,G1,Ctxt, SameLine).
   
  -append_clause_body(B,D,Ctxt, SameLine) ->
  -     Arrow = case SameLine of 
  +append_clause_body(B,D,Ctxt, SameLine={BodyStartLn, HeadLastLn}) ->
  +    Arrow = case BodyStartLn==HeadLastLn of 
    		true -> text(" -> ");
    		_ -> text(" ->")
    	    end,
       append_clause_body(B,D,floating(Arrow),Ctxt, SameLine).
   
   
  -append_rule_body(B,D,Ctxt, SameLine) ->
  -     R = case SameLine of
  +append_rule_body(B,D,Ctxt, SameLine={BodyStartLn, HeadLastLn}) ->
  +    R = case BodyStartLn==HeadLastLn of
    	    true -> text(" :- ");
    	    _ -> text(" :-")
    	end,
  -   append_clause_body(B,D,floating(R),Ctxt, SameLine).
  -
  -append_clause_body(B,D,S,Ctxt, SameLine) ->
  -    case SameLine of 
  -	true -> beside(beside(D,S), nest(Ctxt#ctxt.break_indent,B));
  -	false ->  above(beside(D,S),nest(Ctxt#ctxt.break_indent,B));
  +    append_clause_body(B,D,floating(R),Ctxt, SameLine).
  +
  +append_clause_body(B,D,S,Ctxt, _SameLine={BodyStartLn, HeadLastLn}) ->
  +    case BodyStartLn-HeadLastLn of 
  +	0 -> beside(beside(D,S), nest(Ctxt#ctxt.break_indent,B));
  +	1 -> above(beside(D,S),nest(Ctxt#ctxt.break_indent,B));
  +	2 -> above(beside(D,S), nest(Ctxt#ctxt.break_indent,above(text(""),B)));
   	_  -> sep([beside(D, S), nest(Ctxt#ctxt.break_indent, B)])
       end.
   
  
positive.code: lay_1(Node,Ctxt) ->
      case refac_syntax:has_comments(Node) of
        true ->
  	  D1 = lay_2(Node,Ctxt),
  	  D2 = lay_postcomments(refac_syntax:get_postcomments(Node),D1),
  	  lay_precomments(refac_syntax:get_precomments(Node),D2);
        false -> lay_2(Node,Ctxt)
      end.
  
  %% For pre-comments, all padding is ignored.
  
negative.code: %% =====================================================================
  
  get_start_line(Node) ->
      PreComs = refac_syntax:get_precomments(Node),
      {{L, _C}, _}= refac_util:get_range(Node),
      case PreComs of 
  	[] -> L;
  	_ -> element(1, refac_syntax:get_pos(hd(PreComs)))
      end.
     
    
  get_end_line(Node) ->
      PostComs = refac_syntax:get_postcomments(Node),
      {_, {L, _C}} =refac_util:get_range(Node),
      case PostComs of
  	[] -> L;
  	_ -> LastCom =lists:last(PostComs),
  	     LastComText = refac_syntax:comment_text(LastCom),
  	     element(1, refac_syntax:get_pos(LastCom))+ 
  		 length(LastComText) -1
      end.
  	     
  
  horizontal([D]) -> D;
  horizontal([D| Ds]) -> beside(beside(D, nil()),horizontal(Ds));
  